Here you can find the source of getPage(List
public static <E> List<E> getPage(List<E> all, int first, int pageSize)
//package com.java2s; /*//from w w w . j a va 2s. c o m * * * Copyright (C) 2007 Pingtel Corp., certain elements licensed under a Contributor Agreement. * Contributors retain copyright to elements licensed under a Contributor Agreement. * Licensed to the User under the LGPL license. * * */ import java.util.List; public class Main { public static <E> List<E> getPage(List<E> all, int first, int pageSize) { int last = first + pageSize; if (last > all.size()) { last = all.size(); } return all.subList(first, last); } }