### Question:
FreeIpaPasswordUtil { public static String generatePassword() { String upperCaseLetters = RandomStringUtils.randomAlphabetic(PWD_PART_LENGTH).toUpperCase(); String lowerCaseLetters = RandomStringUtils.randomAlphabetic(PWD_PART_LENGTH).toLowerCase(); String pwdPrefix = RandomStringUtils.randomAlphabetic(PWD_PREFIX_LENGTH); String numbers = RandomStringUtils.randomNumeric(PWD_PART_LENGTH); String raw = upperCaseLetters.concat(lowerCaseLetters).concat(numbers).concat(SPECIAL_CHARS); List<String> list = Arrays.asList(raw.split("")); Collections.shuffle(list); return pwdPrefix.concat(String.join("", list)); } private  FreeIpaPasswordUtil(); static String generatePassword();  }### Answer:
@Test public void testGeneratePasswordShouldCreatePwdWithCorrectSize() { String actual = FreeIpaPasswordUtil.generatePassword(); Assert.assertEquals(32, actual.length()); }
@Test public void testGeneratePassword() { String actual = FreeIpaPasswordUtil.generatePassword(); long characterClasses = PATTERNS.stream().filter(actual::matches).count(); Assert.assertEquals(4, characterClasses); }