void (final String annotationFqn, final Set<String> groups, final boolean skipUnrelated, final Map<PsiClass, Map<PsiMethod, List<String>>> results, final Set<PsiMember> alreadyMarkedToBeChecked, final GlobalSearchScope searchScope, final Set<PsiMember> membersToCheckNow, final PsiClass... classes) { ApplicationManager.getApplication().runReadAction(() -> { final Project project = classes[0].getProject(); final PsiClass testAnnotation = JavaPsiFacade.getInstance(project).findClass(annotationFqn, GlobalSearchScope.allScope(project)); if (testAnnotation == null) { return; } for (PsiMember psiMember : AnnotatedMembersSearch.search(testAnnotation, searchScope)) { final PsiClass containingClass = psiMember.getContainingClass(); if (containingClass == null) continue; if (skipUnrelated && ArrayUtil.find(classes, containingClass) < 0) continue; final PsiAnnotation annotation = AnnotationUtil.findAnnotation(psiMember, annotationFqn); if (TestNGUtil.isAnnotatedWithParameter(annotation, "groups", groups)) { if (appendMember(psiMember, alreadyMarkedToBeChecked, results)) { membersToCheckNow.add(psiMember); } } } }); }