Collection<LombokProblem> (@NotNull PsiAnnotation psiAnnotation) { Collection<LombokProblem> result = Collections.emptyList(); // check first for fields, methods and filter it out, because PsiClass is parent of all annotations and will match other parents too PsiElement psiElement = PsiTreeUtil.getParentOfType(psiAnnotation, PsiField.class, PsiMethod.class, PsiClass.class); if (psiElement instanceof PsiClass) { ProblemValidationSink problemNewBuilder = new ProblemValidationSink(); validate(psiAnnotation, (PsiClass) psiElement, problemNewBuilder); result = problemNewBuilder.getProblems(); } return result; }