question: private static List < String > crossCatenate ( List < List < String > > allWordsList ) { List < String > crossList = new ArrayList < String > ( allWordsList . get ( 0 ) ) ; for ( List < String > wordList : allWordsList . subList ( 1 , allWordsList . size ( ) ) ) { int priorCrossListLength = crossList . size ( ) ; crossList = replicate ( crossList , wordList . size ( ) ) ; for ( int i = 0 ; i < wordList . size ( ) ; i ++ ) { for ( int j = 0 ; j < priorCrossListLength ; j ++ ) { int index = i * priorCrossListLength + j ; crossList . set ( index , crossList . get ( index ) + " " + wordList . get ( i ) ) ; } } } return crossList ; }
target:  Function to perform a cross product concatenation of separate rewritten term lists For example if there are K lists: <l1>,<l2>,<l3>,...,<lK> Function creates a combined list <l> containing all possible K-combinations where each combination contains an entry from each of the K lists combinations maintain order in which terms were parsed