Here you can find the source of getSubListFromStart(List
public final static <T> List<T> getSubListFromStart(List<T> list, int length)
//package com.java2s; import java.util.List; public class Main { public final static <T> List<T> getSubListFromStart(List<T> list, int length) { List<T> listSub = null; if (list != null) { length = list.size() > length ? length : list.size(); listSub = list.subList(0, length); }/* ww w .ja va 2 s . co m*/ return listSub; } }