Here you can find the source of splitter(List
public static <T> List<List<T>> splitter(List<T> list, final int L)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { public static <T> List<List<T>> splitter(List<T> list, final int L) { List<List<T>> parts = new ArrayList<List<T>>(); final int N = list.size(); for (int i = 0; i < N; i += L) { parts.add(list.subList(i, Math.min(N, i + L))); }/*from w w w .j a v a 2 s . co m*/ return parts; } }