question: 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 ( ) ; }
target:  returns a new random sentence, up to maxSentenceLength "words" in length. each word is a single character (a-z). The first one is capitalized.