boolean (@NotNull PsiMethod psiMethod) { final PsiClass containingClass = psiMethod.getContainingClass(); if (containingClass == null) { return false; } if (isTestMethod(PsiLocation.fromPsiElement(psiMethod), false)) { if (containingClass.hasModifierProperty(PsiModifier.ABSTRACT)) { final boolean[] foundNonAbstractInheritor = new boolean[1]; ClassInheritorsSearch.search(containingClass).forEach(psiClass -> { if (!psiClass.hasModifierProperty(PsiModifier.ABSTRACT)) { foundNonAbstractInheritor[0] = true; return false; } return true; }); if (foundNonAbstractInheritor[0]) { return true; } } else { return true; } } final String name = psiMethod.getName(); final boolean isPublic = psiMethod.hasModifierProperty(PsiModifier.PUBLIC); if (!psiMethod.hasModifierProperty(PsiModifier.ABSTRACT)) { if (isPublic && (SUITE_METHOD_NAME.equals(name) || "setUp".equals(name) || "tearDown".equals(name))) { return true; } if (psiMethod.hasModifierProperty(PsiModifier.STATIC)) { if (AnnotationUtil.isAnnotated(psiMethod, STATIC_CONFIGS, 0)) { return isPublic; } if (AnnotationUtil.isAnnotated(psiMethod, STATIC_5_CONFIGS, 0)) { return true; } } else { if (AnnotationUtil.isAnnotated(psiMethod, INSTANCE_CONFIGS, 0)) { return isPublic; } if (AnnotationUtil.isAnnotated(psiMethod, INSTANCE_5_CONFIGS, 0)) { return true; } if (AnnotationUtil.isAnnotated(psiMethod, STATIC_5_CONFIGS, 0) && TestUtils.testInstancePerClass(containingClass)) { return true; } } } return false; }