Here you can find the source of subList(List
public static <K> List<K> subList(List<K> list, int begin, int end)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { /**/*from www. j a v a 2 s . c o m*/ * Sublists the given list. */ public static <K> List<K> subList(List<K> list, int begin, int end) { List<K> temp = new ArrayList<>(end - begin); for (int i = begin; i <= end; i++) { temp.add(list.get(i)); } return temp; } }