static String generateJdbcPassword() {
    int numLower = 2;
    int numUpper = 2;
    int numSpecial = 2;
    return generatePassword(
        MIN_PASSWORD_LENGTH,
        MAX_PASSWORD_LENGTH,
        numLower,
        numUpper,
        numSpecial,
        ALLOWED_SPECIAL_CHARS);
  }
@Test
  public void testGeneratePasswordMeetsRequirements() {
    for (int i = 0; i < 10000; i++) {
      String password = generateJdbcPassword();
      int lower = 0;
      int upper = 0;
      int special = 0;

      for (int j = 0; j < password.length(); j++) {
        char c = password.charAt(j);
        String s = String.valueOf(c);
        lower += s.toLowerCase().equals(s) ? 1 : 0;
        upper += s.toUpperCase().equals(s) ? 1 : 0;
        special += ALLOWED_SPECIAL_CHARS.contains(c) ? 1 : 0;
      }

      assertThat(lower).isAtLeast(2);
      assertThat(upper).isAtLeast(2);
      assertThat(special).isAtLeast(2);
    }
  }