static private < T > void fillList ( final int listsToAdd , Stack < List < T > > reusableLists , List < List < T > > aSplit ) { for ( int j = 0 ; j < listsToAdd ; j ++ ) if ( reusableLists . isEmpty ( ) ) aSplit . add ( new ArrayList <> ( ) ) ; else aSplit . add ( reusableLists . pop ( ) ) ; }
Add lists to a list of lists