private String newSentence(Random r,int maxSentenceLength){
  StringBuilder sb=new StringBuilder();
  int numElements=TestUtil.nextInt(r,1,maxSentenceLength);
  for (int i=0; i < numElements; i++) {
    if (sb.length() > 0) {
      sb.append(' ');
      sb.append((char)TestUtil.nextInt(r,'a','z'));
    }
 else {
      sb.append((char)TestUtil.nextInt(r,'A','Z'));
    }
  }
  sb.append(". ");
  return sb.toString();
}

private String newSentence ( Random r , int maxSentenceLength ) { StringBuilder sb = new StringBuilder ( ) ; int numElements = TestUtil . nextInt ( r , 1 , maxSentenceLength ) ; for ( int i = 0 ; i < numElements ; i ++ ) { if ( sb . length ( ) > 0 ) { sb . append ( ' ' ) ; sb . append ( ( char ) TestUtil . nextInt ( r , 'a' , 'z' ) ) ; } else { sb . append ( ( char ) TestUtil . nextInt ( r , 'A' , 'Z' ) ) ; } } sb . append ( ". " ) ; return sb . toString ( ) ; }
returns a new random sentence , up to maxsentencelength " words " in length . each word is a single character ( a - z ) . the first one is capitalized .
