emp.setEmpId("M1234");
emp.setFirstName("MADHUMITA");
emp.setLastName("SADHUKHAN");
emp.setEmail("madhu@redhat.com");
Set<ConstraintViolation<Employee>> constraintViolations = validator.validate(emp);
assertEquals("Wrong number of constraints", constraintViolations.size(), 1);
assertEquals("Created by default factory", constraintViolations.iterator().next().getMessage());
// get a new factory using a custom configuration
configuration.constraintValidatorFactory(new CustomConstraintValidatorFactory(configuration