Here you can find the source of sublist(List
public static <T> List<T> sublist(List<T> list, int start, int limit)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { /**/*from w w w. j a v a 2s. c o m*/ * Sub list * * @return */ public static <T> List<T> sublist(List<T> list, int start, int limit) { int fromIndex = Math.min(start, list.size()); int toIndex = Math.min(fromIndex + limit, list.size()); return list.subList(fromIndex, toIndex); } }