### Question:
LuhnIdentifierValidator extends BaseHyphenatedIdentifierValidator { @Override public String getValidIdentifier(String undecoratedIdentifier) throws UnallowedIdentifierException { checkAllowedIdentifier(undecoratedIdentifier); int checkDigit = getCheckDigit(undecoratedIdentifier); return undecoratedIdentifier + "-" + checkDigit; }  @Override String getName(); @Override String getAllowedCharacters(); @Override String getValidIdentifier(String undecoratedIdentifier);  }### Answer:
@Test public void getValidIdentifier_shouldGetValidIdentifier() { for (int i = 0; i < allowedIdentifiers.length; i++) { assertEquals(validator.getValidIdentifier(allowedIdentifiers[i]), allowedIdentifiers[i] + "-" + allowedIdentifiersCheckDigitsInts[i]); } }
@Test public void getValidIdentifier_shouldFailWithInvalidIdentifiers() { for (String invalidIdentifier : invalidIdentifiers) { try { validator.getValidIdentifier(invalidIdentifier); fail("Identifier " + invalidIdentifier + " should have failed."); } catch (UnallowedIdentifierException e) { } } }