code: private Object validate(Annotation[] annotations, Object value) {
          final Class<?>[] classes = findValidationGroups(annotations);
  
          if (classes != null) {
              final ImmutableList<String> errors = ConstraintViolations.format(
                      validator.validate(value, classes));
  
              if (!errors.isEmpty()) {
                  String message = "\n";
                  for (String error : errors) {
                      message += "    " + error + "\n";
                  }
                  throw new ValidationException(message);
              }
          }
  
          return value;
      }
docs: Copied and modified from com.yammer.dropwizard.jersey.jackson#JacksonMessageBodyProvider.validate()
  Notes on Hibernate Validator:
  - when validating object graphs, null references are ignored.
  - from version 5 on, Hibernate Validator throws IllegalArgumentException instead of ValidationException
  for null parameter values:
  java.lang.IllegalArgumentException: HV000116: The object to be validated must not be null.