### Question:
DefaultDMNValidator 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.id'"); validateUnique( "DRGElement", "id", false, dmnModelRepository, new ArrayList<>(dmnModelRepository.findDRGElements(definitions)), TDMNElement::getId, null, errors ); logger.debug("Validate unique 'DRGElement.name'"); validateUnique( "DRGElement", "name", false, dmnModelRepository, new ArrayList<>(dmnModelRepository.findDRGElements(definitions)), e -> ((TNamedElement)e).getName(), null, errors ); logger.debug("Validate unique 'ItemDefinition.name'"); validateUnique( "ItemDefinition", "name", false, dmnModelRepository, new ArrayList<>(dmnModelRepository.findItemDefinitions(definitions)), e -> ((TNamedElement)e).getName(), null, errors ); for (TDRGElement element : dmnModelRepository.findDRGElements(definitions)) { logger.debug(String.format("Validate element '%s'", element.getName())); if (element instanceof TInputData) { validateInputData((TInputData) element, errors); } else if (element instanceof TBusinessKnowledgeModel) { validateBusinessKnowledgeModel((TBusinessKnowledgeModel) element, errors); } else if (element instanceof TDecision) { validateDecision((TDecision) element, dmnModelRepository, errors); } } } return errors; } DefaultDMNValidator();  DefaultDMNValidator(BuildLogger logger); @Override List<String> validate(DMNModelRepository dmnModelRepository);  }### Answer:
@Test public void testValidateWhenCorrect() { List<String> expectedErrors = Arrays.asList(); validate(validator, "tck/cl3/input/0020-vacation-days.dmn", expectedErrors); }
@Test public void testValidateDefinitionsWhenNotUniqueNames() { List<String> expectedErrors = Arrays.asList( "The 'name' of a 'DRGElement' must be unique. Found duplicates for 'CIP Assessments, Input'.", "The 'name' of a 'ItemDefinition' must be unique. Found duplicates for 'itemDefinition'.", "Missing variable for 'CIP Assessments'", "Missing variable for 'CIP Assessments'" ); validate(validator, "dmn/input/test-dmn-with-duplicates.dmn", expectedErrors); }
@Test public void testValidateDefinitionsWithError() { List<String> expectedErrors = Arrays.asList( "Missing variable for 'CIP Assessments'" ); validate(validator, "dmn/input/test-dmn.dmn", expectedErrors); }
@Test(expected = IllegalArgumentException.class) public void testValidateDefinitionsWhenNull() { validator.validate(null); }