### Question:
ValidatorImpl implements Validator { public BeanDescriptor getConstraintsForClass(Class<?> clazz) { return getBeanMetaData( clazz ).getBeanDescriptor(); } ValidatorImpl(ConstraintValidatorFactory constraintValidatorFactory, MessageInterpolator messageInterpolator, TraversableResolver traversableResolver, ConstraintHelper constraintHelper, BeanMetaDataCache beanMetaDataCache); Set<ConstraintViolation<T>> validate(T object, Class<?>... groups); Set<ConstraintViolation<T>> validateProperty(T object, String propertyName, Class<?>... groups); Set<ConstraintViolation<T>> validateValue(Class<T> beanType, String propertyName, Object value, Class<?>... groups); BeanDescriptor getConstraintsForClass(Class<?> clazz);  }### Answer:
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullParamterToValidatorImplConstructor() { TestUtil.getValidator().getConstraintsForClass( null ); }
@Test public void testConstraintDescriptorWithoutExplicitGroup() { Validator validator = TestUtil.getValidator(); BeanDescriptor beanDescriptor = validator.getConstraintsForClass( Order.class ); PropertyDescriptor propertyDescriptor = beanDescriptor.getConstraintsForProperty( "orderNumber" ); Set<ConstraintDescriptor<?>> descriptors = propertyDescriptor.getConstraintDescriptors(); assertEquals( descriptors.size(), 1, "There should be only one constraint descriptor" ); ConstraintDescriptor<?> descriptor = descriptors.iterator().next(); Set<Class<?>> groups = descriptor.getGroups(); assertTrue( groups.size() == 1, "There should be only one group" ); assertEquals( groups.iterator().next(), Default.class, "The declared constraint does not explicitly define a group, hence Default is expected" ); }