class 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;
    }

    public  UniqueNameValidator();
    public  UniqueNameValidator(BuildLogger logger);

}