@Override
public List<ConstraintViolation> validateClassConstraint(Object bean) {
final List<ConstraintViolation> list = new LinkedList<ConstraintViolation>();
if (validator != null && bean != null) {
BeanDescriptor beanDescriptor = validator.getConstraintsForClass(bean.getClass());
Set<ConstraintDescriptor<?>> classLevelConstraints = beanDescriptor.findConstraints().declaredOn(ElementType.TYPE).getConstraintDescriptors();
Set<ConstraintViolation<Object>> constraintViolations = validator.validate(bean);
for (ConstraintViolation constraintViolation : constraintViolations) {
if (classLevelConstraints.contains(constraintViolation.getConstraintDescriptor())) {
list.add(constraintViolation);
}