### Question:
PasswordUtils { public static synchronized String generatePassword(int length) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < length; i++) { sb.append(ALPHANUMERIC_CHARS[SECURE_RANDOM.nextInt(ALPHANUMERIC_CHARS.length)]); } return sb.toString(); } private  PasswordUtils(); static synchronized String generatePassword(int length);  }### Answer:
@Test public void testGeneratePassword() { int len = ThreadLocalRandom.current().nextInt(20); String randomPassword = PasswordUtils.generatePassword(len); assertEquals(len, randomPassword.length()); }