code: protected void validateModelClass(Object model) {
          final Set<ConstraintViolation<Object>> violations = validator.validate(model);
  
          // in case of an invalid model, we throw a ConstraintViolationException, containing the violations:
          if (!violations.isEmpty()) {
              throw new ConstraintViolationException(
                      new HashSet<>(violations));
          }
      }
docs: Generic validator used to identify constraint violations of the given model class.
  
  @param model object to validate
  @throws ConstraintViolationException if constraint violations on the given model have been identified.