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()]));
}

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 ( ) ] ) ) ; }
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 .
