code: public static void checkExpectedValidationViolations(
  			ConstraintViolationException exception,
  			List<String> expectedValidationViolations) {
  
  		if (exception != null && expectedValidationViolations != null) {
  
  			List<String> givenViolations = new ArrayList<String>();
  			for (ConstraintViolation<?> violation : exception
  					.getConstraintViolations()) {
  				givenViolations.add(violation.getMessageTemplate());
  			}
  
  			checkViolations(givenViolations, expectedValidationViolations);
  
  		}
  
  	}
docs: This method checks if the validation violations matches the violations
  given in a ViolationException.
  
  @param exception
  the {@link ConstraintViolationException} containig all
  violations
  @param expectedValidationViolations
  list of expected validation violation message templates