RandomGenerator { public static String generateRandomAlphanumeric(int length) { StringBuilder name = new StringBuilder("n"); for (int i = 0; i < length - 2; i++) { name.append(CHARACTERS[random.nextInt(36)]); } name.append('z'); return name.toString(); } private  RandomGenerator(); static String generateRandomAlphanumeric(int length);  }
@Test public void generate() { assertEquals(255, RandomGenerator.generateRandomAlphanumeric(255).length()); assertTrue(Pattern.matches("^[a-z0-9_]+$", RandomGenerator.generateRandomAlphanumeric(255))); }