class AuthenticatorHelper {

    protected static boolean verifyCharSets(String newPassword) {
        boolean hasLowercase = false;
        boolean hasUppercase = false;
        boolean hasDigit = false;
        boolean hasSpecial = false;

        for (int i = 0; i < newPassword.length(); i++) {
            if (!hasLowercase && Arrays.binarySearch(EncoderConstants.CHAR_LOWERS, newPassword.charAt(i)) >= 0) {
                hasLowercase = true;
            } else if (!hasUppercase && Arrays.binarySearch(EncoderConstants.CHAR_UPPERS, newPassword.charAt(i)) >= 0) {
                hasUppercase = true;
            } else if (!hasDigit && Arrays.binarySearch(EncoderConstants.CHAR_DIGITS, newPassword.charAt(i)) >= 0) {
                hasDigit = true;
            } else if (!hasSpecial && Arrays.binarySearch(CHAR_SPECIALS, newPassword.charAt(i)) >= 0) {
                hasSpecial = true;
            }
        }
        return hasLowercase && hasUppercase && hasDigit && hasSpecial;
    }

}