package com.github.valdr;

import com.google.common.base.Function;
import com.google.common.collect.Iterables;
import lombok.Getter;

import javax.validation.constraints.*;
import java.lang.annotation.Annotation;
import java.util.Arrays;

public enum SupportedValidator {

  Required(NotNull.class), Min(Min.class), Max(Max.class), Size(Size.class), Digits(Digits.class),
  Pattern(Pattern.class), Future(Future.class), Past(Past.class);

  @Getter
  private final Class<? extends Annotation> beanValidationAnnotation;

  private SupportedValidator(Class<? extends Annotation> beanValidationAnnotation) {
    this.beanValidationAnnotation = beanValidationAnnotation;
  }

  public static Iterable<Class<? extends Annotation>> getAllBeanValidationAnnotations() {
    return Iterables.transform(Arrays.asList(values()), new Function<SupportedValidator, Class<? extends Annotation>>() {

      @Override
      public Class<? extends Annotation> apply(SupportedValidator input) {
        return input.getBeanValidationAnnotation();
      }
    });
  }

  public static SupportedValidator valueOfAnnotationClassOrNull(Class<? extends Annotation> beanValidationAnnotation) {
    for (SupportedValidator supportedValidator : values()) {
      if (supportedValidator.getBeanValidationAnnotation().equals(beanValidationAnnotation)) {
        return supportedValidator;
      }
    }
    return null;
  }
}

@@ -965,24 +965,143 @@
 or input) %7B%0A
+        if (input == null) %7B%0A          throw new NullPointerException(%22Passed validator must not be null.%22);%0A        %7D%0A
         retu

Add missing null check.