@Override
public <T extends ConstraintValidator<?, ?>> T getInstance(Class<T> key) {
if (key == NotNullValidator.class) {
return (T) new ErroneousNotNullValidator();
}
return new ConstraintValidatorFactoryImpl().getInstance(key);
}
});
factory = configuration.buildValidatorFactory();
validator = factory.getValidator();