public static String fullName ( ) { StringBuilder result = new StringBuilder ( ) ; if ( RandomBoolean . chance ( 3 , 5 ) ) result . append ( RandomString . pick ( _namePrefixes ) ) . append ( " " ) ; result . append ( RandomString . pick ( _firstNames ) ) . append ( " " ) . append ( RandomString . pick ( _lastNames ) ) ; if ( RandomBoolean . chance ( 5 , 10 ) ) result . append ( " " ) . append ( RandomString . pick ( _nameSuffixes ) ) ; return result . toString ( ) ; }
Generates a random person s name which has the following structure optional prefix - first name - second name - optional suffix