### Question:
PatientIdentifierValidator implements Validator { public static void checkIdentifierAgainstValidator(String identifier, IdentifierValidator validator) throws PatientIdentifierException { log.debug("Checking identifier: " + identifier + " against validator: " + validator); if (StringUtils.isBlank(identifier)) { throw new BlankIdentifierException("PatientIdentifier.error.nullOrBlank"); } if (validator == null) { log.debug("Validator is null, identifier passes."); return; } try { if (!validator.isValid(identifier)) { throw new InvalidCheckDigitException(getMessage("PatientIdentifier.error.checkDigitWithParameter", identifier)); } } catch (UnallowedIdentifierException e) { throw new InvalidCheckDigitException(getMessage("PatientIdentifier.error.unallowedIdentifier", identifier, validator.getName())); } log.debug("The identifier passed validation."); }  @Override boolean supports(Class<?> c); @Override void validate(Object obj, Errors errors); static void validateIdentifier(PatientIdentifier pi); static void validateIdentifier(String identifier, PatientIdentifierType pit); static void checkIdentifierAgainstFormat(String identifier, String format, String formatDescription); static void checkIdentifierAgainstValidator(String identifier, IdentifierValidator validator);  }### Answer:
@Test(expected = BlankIdentifierException.class) public void checkIdentifierAgainstValidator_shouldFailValidationIfIdentifierIsBlank() { PatientIdentifierValidator.checkIdentifierAgainstValidator("", new LuhnIdentifierValidator()); }
@Test(expected = InvalidCheckDigitException.class) public void checkIdentifierAgainstValidator_shouldFailValidationIfIdentifierIsInvalid() { PatientIdentifierValidator.checkIdentifierAgainstValidator("7TU-4", new LuhnIdentifierValidator()); }
@Test public void checkIdentifierAgainstValidator_shouldPassValidationIfIdentifierIsValid() { PatientIdentifierValidator.checkIdentifierAgainstValidator("7TU-8", new LuhnIdentifierValidator()); }
@Test public void checkIdentifierAgainstValidator_shouldPassValidationIfValidatorIsNull() { PatientIdentifierValidator.checkIdentifierAgainstValidator("7TU-4", null); }