/** * Factory method to create a validator, which evaluates the value validity with a given predicate. * Error is created if the evaluation is <code>false</code>. * @param message text of a message to be created if value is invalid * @param predicate the predicate to be used for the value validity evaluation. * @return new validator */ static <T> Validator<T> createPredicateValidator(Predicate<T> predicate, String message) { return createPredicateValidator(predicate, message, Severity.ERROR); }