public static String createRandomData ( int rows , int rowLength , boolean skipTrailingNewline ) { Random random = new Random ( System . currentTimeMillis ( ) ) ; StringBuilder strb = new StringBuilder ( ) ; for ( int i = 0 ; i < rows ; i ++ ) { for ( int j = 0 ; j < rowLength ; j ++ ) { strb . append ( ( char ) ( ( ( int ) ' ' ) + random . nextFloat ( ) * 25 ) ) ; } if ( skipTrailingNewline || i < rows ) { strb . append ( "\n" ) ; } } return strb . toString ( ) ; }
This method creates test data containing letters between a - z