code: @NotNull
      public static <TYPE> Set<ConstraintViolation<TYPE>> validate(@NotNull final Validator validator, @Nullable final TYPE value,
              @Nullable final Class<?>... groups) {
          if (value == null) {
              return new HashSet<ConstraintViolation<TYPE>>();
          }
          return validator.validate(value, groups);
      }
docs: Validates the given object.
  
  @param validator
  Validator to use.
  @param value
  Value to validate.
  @param groups
  Group or list of groups targeted for validation (defaults to {@link Default})
  
  @return List of constraint violations.
  
  @param <TYPE>
  Type of the validated object.