### Question:
CodeLengthValidator implements ServiceAttributeValidator { @Override public boolean validate(Set<String> values) { try { for (String toTest : values) { if (Integer.valueOf(toTest) < MIN_CODE_LENGTH) { return false; } } } catch (NumberFormatException nfe) { return false; } return true; }  @Override boolean validate(Set<String> values); static final int MIN_CODE_LENGTH; }### Answer:
@Test(dataProvider = "data") public void checkCorrectness(String name, boolean expected) { boolean result = validator.validate(Collections.singleton(name)); assertThat(result).isEqualTo(expected); }