code: public static String randomStringInRange(String allowedChars, int size) {
  		char[] randomStr = new char[size];
  
  		Random random = new Random(new Date().getTime());
  
  		final int allowedCharsLength = allowedChars.length();
  		for (int i = 0; i < size; i++) {
  			randomStr[i] = allowedChars.charAt(random.nextInt(allowedCharsLength));
  		}
  
  		return new String(randomStr);
  	}
docs: //////////////