boolean (@NotNull PsiClass psiClass, boolean checkAbstract, boolean checkForTestCaseInheritance) { if (psiClass.getQualifiedName() == null) return false; if (isJUnit5(psiClass)) { if (isJUnit5TestClass(psiClass, checkAbstract)) { return true; } } else if (JavaPsiFacade.getInstance(psiClass.getProject()).findClass(CUSTOM_TESTABLE_ANNOTATION, psiClass.getResolveScope()) != null && MetaAnnotationUtil.isMetaAnnotatedInHierarchy(psiClass, CUSTOM_TESTABLE_ANNOTATION_LIST) || hasTestableMetaAnnotation(psiClass)) { //no jupiter engine in the classpath return true; } if (!PsiClassUtil.isRunnableClass(psiClass, true, checkAbstract)) return false; final PsiClass topLevelClass = getTopmostClass(psiClass); if (topLevelClass != null) { final PsiAnnotation annotation = AnnotationUtil.findAnnotationInHierarchy(topLevelClass, Collections.singleton(RUN_WITH)); if (annotation != null) { if (topLevelClass == psiClass) { return true; } if (!isInheritorOrSelfRunner(annotation, RUNNERS_UNAWARE_OF_INNER_CLASSES)) { return true; } } } if (AnnotationUtil.isAnnotated(psiClass, RUN_WITH, CHECK_HIERARCHY)) return true; if (checkForTestCaseInheritance && isTestCaseInheritor(psiClass)) return true; return CachedValuesManager.getCachedValue(psiClass, () -> CachedValueProvider.Result.create(hasTestOrSuiteMethods(psiClass), PsiModificationTracker.MODIFICATION_COUNT)); }