String (AbstractTestProxy testInfo, Project project, GlobalSearchScope searchScope) { String nodeId = testInfo.getUserData(SMTestProxy.NODE_ID); if (nodeId != null) { Location location = testInfo.getLocation(project, searchScope); if (location == null) return nodeId; PsiElement psiElement = location.getPsiElement(); UMethod uMethod = UastContextKt.getUastParentOfType(psiElement, UMethod.class); if (uMethod != null) { PsiClass containingClass = uMethod.getContainingClass(); TestFramework testFramework = containingClass != null ? TestFrameworks.detectFramework(containingClass) : null; if (testFramework == null || !testFramework.isTestMethod(psiElement)) { return nodeId; } } else { UClass containingClass = UastContextKt.getUastParentOfType(psiElement, UClass.class); if (containingClass == null || TestFrameworks.detectFramework(containingClass) == null || UastContextKt.getUastParentOfType(psiElement, UField.class) != null) { return nodeId; } } AbstractTestProxy parent = testInfo.getParent(); if (parent != null) { Location parentLocation = parent.getLocation(project, searchScope); if (parentLocation != null && parentLocation.getPsiElement() == psiElement) { return nodeId; } } } return null; }