Here you can find the source of getSubList(List
public static <T> List<T> getSubList(List<T> allKeys, String part)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static <T> List<T> getSubList(List<T> allKeys, String part) { int start = Integer.parseInt(part.split(":")[0]); int end = Integer.parseInt(part.split(":")[1]); if (end > allKeys.size()) { end = allKeys.size();/*from w ww . j a v a 2 s.c om*/ } return allKeys.subList(start, end); } }