question: public static < T > List < List < T > > split ( int partitionSize , List < T > collection ) { List < List < T > > lists = new LinkedList < List < T > > ( ) ; for ( int i = 0 ; i < collection . size ( ) ; i += partitionSize ) { int jLimit = Math . min ( collection . size ( ) , i + partitionSize ) ; List < T > newList = new LinkedList < T > ( ) ; for ( int j = i ; j < jLimit ; j ++ ) { newList . add ( collection . get ( j ) ) ; } lists . add ( newList ) ; } return lists ; }
target:  Split a collection in Lists of up to partitionSize elements.