I’ve found a fine solution for pagination any list on stackoverflow. It use a static method that breaks a generic collection into a list of pages (which are also lists).
public static <T> List<List<T>> getPages(Collection<T> c, Integer pageSize) { if (c == null) return Collections.emptyList(); List<T> list = new ArrayList<T>(c); if (pageSize == null || pageSize <= 0 || pageSize > list.size()) pageSize = list.size(); int numPages = (int) Math.ceil((double)list.size() / (double)pageSize); List<List<T>> pages = new ArrayList<List<T>>(numPages); for (int pageNum = 0; pageNum < numPages;) pages.add(list.subList(pageNum * pageSize, Math.min(++pageNum * pageSize, list.size()))); return pages; }