question: private String addValue ( ) { List < String > terms = new ArrayList < > ( ) ; int maxCeiling = TestUtil . nextInt ( random ( ) , 0 , 255 ) ; int max = 0 ; for ( char ch = 'a' ; ch <= 'z' ; ch ++ ) { int num = TestUtil . nextInt ( random ( ) , 0 , maxCeiling ) ; for ( int i = 0 ; i < num ; i ++ ) terms . add ( Character . toString ( ch ) ) ; max = Math . max ( max , num ) ; } expected . add ( max ) ; Collections . shuffle ( terms , random ( ) ) ; return Arrays . toString ( terms . toArray ( new String [ terms . size ( ) ] ) ) ; }
target:  Makes a bunch of single-char tokens (the max freq will at most be 255). shuffles them around, and returns the whole list with Arrays.toString(). This works fine because we use lettertokenizer. puts the max-frequency term into expected, to be checked against the norm.