class NoUnmatchedElementsValidator implements ConstraintValidator<NoUnmatchedElements, ConfigItem> {

    @Override
    public boolean isValid(ConfigItem configItem, ConstraintValidatorContext constraintValidatorContext) {
        Optional.ofNullable(configItem.getUnmatched()).ifPresent(
            list -> {
                list.forEach(e -> {
                    if (Element.class.isAssignableFrom(e.getClass())) {
                        Element element = Element.class.cast(e);
                        LOGGER.warn("Ignoring unknown/unmatched json element: {}", element.getTagName());
                    }
                });
            }
        );
        return true; // just log a warning, don't stop startup
    }

}