Here you can find the source of split(final List list, final int count)
public static List split(final List list, final int count)
//package com.java2s; //License from project: LGPL import java.util.ArrayList; import java.util.List; public class Main { public static List split(final List list, final int count) { List subIdLists = new ArrayList(); if (list.size() < count) { subIdLists.add(list);// w ww .jav a 2 s .c om } else { int i = 0; while (i < list.size()) { int end = i + count; if (end > list.size()) { end = list.size(); } subIdLists.add(list.subList(i, end)); i += count; } } return subIdLists; } }