code: public static String randomString( char[] values, int len )
      {
          Random rnd = new SecureRandom();
          StringBuilder sb = new StringBuilder( len );
          for ( int i = 0; i < len; i++ ) {
              sb.append( values[ rnd.nextInt( values.length )] );
          }
          return sb.toString();
      }
docs: Generate a random String
  
  @param values The characters list to use in the randomization
  @param len The number of characters in the output String
  @return The randomized String