void (Map<PsiClass, Map<PsiMethod, List<String>>> classes, GlobalSearchScope scope, Project project, AbstractTestProxy proxy) { final Location location = proxy.getLocation(project, scope); if (location != null) { final PsiElement element = location.getPsiElement(); if (element instanceof PsiMethod psiMethod && element.isValid()) { PsiClass psiClass = psiMethod.getContainingClass(); if (psiClass != null && psiClass.hasModifierProperty(PsiModifier.ABSTRACT)) { final AbstractTestProxy parent = proxy.getParent(); final PsiElement elt = parent != null ? parent.getLocation(project, scope).getPsiElement() : null; if (elt instanceof PsiClass) { psiClass = (PsiClass)elt; } } TestNGTestObject.collectTestMethods(classes, psiClass, psiMethod.getName(), scope); Map<PsiMethod, List<String>> psiMethods = classes.get(psiClass); if (psiMethods == null) { psiMethods = new LinkedHashMap<>(); classes.put(psiClass, psiMethods); } List<String> strings = psiMethods.get(psiMethod); if (strings == null || strings.isEmpty()) { strings = new ArrayList<>(); } setupParameterName(location, strings); psiMethods.put(psiMethod, strings); } } }