Here you can find the source of getSubList(List
public static <T> List<T> getSubList(List<T> list, int from, int maxnum)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { public static <T> List<T> getSubList(List<T> list, int from, int maxnum) { if (list == null || list.size() <= from) return new ArrayList<T>(); return new ArrayList(list.subList(from, Math.min(from + maxnum, list.size()))); }/*from w ww. j a va 2s .c om*/ }