web/play-java-forms/src/main/java/play/data/validation/MappedConstraintValidatorFactory.java
public <T extends ConstraintValidator<?, ?>>
      MappedConstraintValidatorFactory addConstraintValidator(Class<T> key, T constraintValidator) {
    validators.put(key, () -> constraintValidator);
    return this;
  }
public <T extends ConstraintValidator<?, ?>>
      MappedConstraintValidatorFactory addConstraintValidator(Class<T> key, T constraintValidator) {
    validators.put(key, () -> constraintValidator);
    return this;
  }
Adds validator as a singleton.

@param key the constraint validator type
@param constraintValidator the constraint validator instance
@param <T> the type of constraint validator implementation
@return {@link MappedConstraintValidatorFactory} with the given constraint validator added.