Java tutorial
//package com.java2s; import java.util.ArrayList; import java.util.Collection; import java.util.List; public class Main { public static <T> List<T> subCollection(Collection<T> collection, int start, int end) { if (null == collection || collection.isEmpty()) return null; int count = 0; List<T> result = new ArrayList<T>(); for (T item : collection) { if (start >= count && count < end) { result.add(item); } count++; } return result; } }