### Question:
UniqueNameValidator extends SimpleDMNValidator { @Override public List<String> validate(DMNModelRepository dmnModelRepository) { List<String> errors = new ArrayList<>(); if (dmnModelRepository == null) { throw new IllegalArgumentException("Missing definitions"); } for (TDefinitions definitions: dmnModelRepository.getAllDefinitions()) { logger.debug("Validate unique 'DRGElement.name'"); validateUnique( "DRGElement", "name", false, new ArrayList<>(dmnModelRepository.findDRGElements(definitions)), TNamedElement::getName, null, errors ); logger.debug("Validate unique 'ItemDefinition.name'"); validateUnique( "ItemDefinition", "name", false, new ArrayList<>(dmnModelRepository.findItemDefinitions(definitions)), TNamedElement::getName, null, errors ); } return errors; } UniqueNameValidator();  UniqueNameValidator(BuildLogger logger); @Override List<String> validate(DMNModelRepository dmnModelRepository);  }### Answer:
@Test public void testValidateWhenCorrect() { validate(validator, "tck/cl3/input/0020-vacation-days.dmn", new ArrayList<>()); }
@Test public void testValidateDefinitionsWhenNotUniqueNames() { List<String> expectedErrors = Arrays.asList( "The 'name' of a 'DRGElement' must be unique. Found 3 duplicates for 'CIP Assessments'.", "The 'name' of a 'DRGElement' must be unique. Found 2 duplicates for 'Input'.", "The 'name' of a 'ItemDefinition' must be unique. Found 2 duplicates for 'itemDefinition'." ); validate(validator, "dmn/input/test-dmn-with-duplicates.dmn", expectedErrors); }
@Test(expected = IllegalArgumentException.class) public void testValidateDefinitionsWhenNull() { validator.validate(null); }