Set<ConstraintViolation<EmailContainer>> violations = validator.validate( container );
assertOrgAddressesAreNotValid( violations );
// now the same test with programmatic configuration
final HibernateValidatorConfiguration config = getConfiguration( HibernateValidator.class );
ConstraintMapping mapping = config.createConstraintMapping();
mapping.type( EmailContainer.class )
.property( "email", METHOD )
.constraint(
new EmailDef().regexp( noOrgEmailAddressRegexp )
.message( "ORG addresses are not valid" )
);