public static @Nullable TargetType findAnnotationTarget(@NotNull PsiAnnotation annotation, TargetType @NotNull ... types) {
    if (types.length != 0) {
      PsiClass annotationType = annotation.resolveAnnotationType();
      if (annotationType != null) {
        return findAnnotationTarget(annotationType, types);
      }
    }

    return TargetType.UNKNOWN;
  }
public static @Nullable TargetType findAnnotationTarget(@NotNull PsiAnnotation annotation, TargetType @NotNull ... types)