public Optional<ValidationException> invalidException(Map<ValidationId, ? extends Collection<String>> messagesByValidationId, Instant now) {
        Map<ValidationId, Collection<String>> disallowed = new HashMap<>(messagesByValidationId);
        disallowed.keySet().removeIf(id -> allows(id, now));

        if (disallowed.size() == 1 && disallowed.values().iterator().next().size() == 1) // Single-message form if possible.
            return Optional.of(new ValidationException(disallowed.keySet().iterator().next(),
                                                       disallowed.values().iterator().next().iterator().next()));

        if ( ! disallowed.isEmpty())
            return Optional.of(new ValidationException(disallowed));

        return Optional.empty();
    }
Throws a ValidationException unless this validation is overridden at this time
config-model-api/src/main/java/com/yahoo/config/application/api/ValidationOverrides.java