CD21 cd = new CD21("Kind of Blue", 12.5f);
ExecutableValidator methodValidator = validator.forExecutables();
Method method = CD21.class.getMethod("calculatePrice", Float.class);
Set<ConstraintViolation<CD21>> violations = methodValidator.validateParameters(cd, method, new Object[]{new Float(1.2)});
displayContraintViolations(violations);
assertEquals(1, violations.size());
assertEquals("must be greater than or equal to 1.4", violations.iterator().next().getMessage());
assertEquals(new Float(1.2), violations.iterator().next().getInvalidValue());
assertEquals("{javax.validation.constraints.DecimalMin.message}", violations.iterator().next().getMessageTemplate());