void (final Map<PsiClass, Map<PsiMethod, List<String>>> results, final Set<PsiMember> alreadyMarkedToBeChecked, final Set<PsiMember> membersToCheckNow, final PsiMethod[] methods, final PsiClass... classes) { final PsiClass[] psiClasses; if (methods != null && methods.length > 0) { final Set<PsiClass> containingClasses = new LinkedHashSet<>(); for (final PsiMethod method : methods) { containingClasses.add(ReadAction.compute(() -> method.getContainingClass())); } psiClasses = containingClasses.toArray(PsiClass.EMPTY_ARRAY); } else { psiClasses = classes; } for (final PsiClass containingClass : psiClasses) { final Set<String> testMethodDependencies = new LinkedHashSet<>(); final HashMap<String, Collection<String>> valuesMap = new HashMap<>(); valuesMap.put("dependsOnMethods", testMethodDependencies); TestNGUtil.collectAnnotationValues(valuesMap, methods, containingClass); if (!testMethodDependencies.isEmpty()) { ApplicationManager.getApplication().runReadAction(() -> { final Project project = containingClass.getProject(); final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project); for (String dependency : testMethodDependencies) { final String className = StringUtil.getPackageName(dependency); final String methodName = StringUtil.getShortName(dependency); if (StringUtil.isEmpty(className)) { checkClassMethods(methodName, containingClass, alreadyMarkedToBeChecked, membersToCheckNow, results); } else { final PsiClass aClass = psiFacade.findClass(className, containingClass.getResolveScope()); if (aClass != null) { checkClassMethods(methodName, aClass, alreadyMarkedToBeChecked, membersToCheckNow, results); } } } }); } } }