void (final PsiMethod[] methods, final Map<PsiClass, Map<PsiMethod, List<String>>> results, final Set<PsiMember> alreadyMarkedToBeChecked, final GlobalSearchScope searchScope, final PsiClass @Nullable ... classes) { if (classes != null && classes.length > 0) { final Set<PsiMember> membersToCheckNow = new LinkedHashSet<>(); final Set<String> groupDependencies = new LinkedHashSet<>(), declaredGroups = new LinkedHashSet<>(); final HashMap<String, Collection<String>> valuesMap = new HashMap<>(); valuesMap.put("dependsOnGroups", groupDependencies); valuesMap.put("groups", declaredGroups); //find all mentioned groups and dependsOnGroup values TestNGUtil.collectAnnotationValues(valuesMap, methods, classes); if (!groupDependencies.isEmpty()) { collectGroupsMembers(TestNGUtil.TEST_ANNOTATION_FQN, groupDependencies, true, results, alreadyMarkedToBeChecked, searchScope, membersToCheckNow, classes); } if (!declaredGroups.isEmpty()) { for (String annotationFqn : GROUPS_CONFIGURATION) { collectGroupsMembers(annotationFqn, declaredGroups, false, results, alreadyMarkedToBeChecked, searchScope, membersToCheckNow, classes); } } collectDependsOnMethods(results, alreadyMarkedToBeChecked, membersToCheckNow, methods, classes); if (methods == null) { for (PsiClass c : classes) { results.put(c, new LinkedHashMap<>()); } } else { for (PsiMember psiMember : membersToCheckNow) { PsiClass psiClass; PsiMethod[] meths = null; if (psiMember instanceof PsiMethod) { psiClass = psiMember.getContainingClass(); meths = new PsiMethod[] {(PsiMethod)psiMember}; } else { psiClass = (PsiClass)psiMember; } calculateDependencies(meths, results, alreadyMarkedToBeChecked, searchScope, psiClass); } } } }