public String haikunate ( ) { if ( tokenHex ) { tokenChars = "0123456789abcdef" ; } String adjective = randomString ( adjectives ) ; String noun = randomString ( nouns ) ; StringBuilder token = new StringBuilder ( ) ; if ( tokenChars != null && tokenChars . length ( ) > 0 ) { for ( int i = 0 ; i < tokenLength ; i ++ ) { token . append ( tokenChars . charAt ( random . nextInt ( tokenChars . length ( ) ) ) ) ; } } return Stream . of ( adjective , noun , token . toString ( ) ) . filter ( s -> s != null && ! s . isEmpty ( ) ) . collect ( joining ( delimiter ) ) ; }
Generate heroku - like random names