boolean (@NotNull final PsiClass psiClass, boolean checkAbstract) { final PsiModifierList modifierList = psiClass.getModifierList(); if (modifierList == null) return false; if (psiClass.isAnnotationType()) return false; if (psiClass.getContainingClass() != null && !psiClass.hasModifierProperty(PsiModifier.PRIVATE) && !psiClass.hasModifierProperty(PsiModifier.STATIC) && MetaAnnotationUtil.isMetaAnnotated(psiClass, Collections.singleton(JUNIT5_NESTED))) { return true; } if (MetaAnnotationUtil.isMetaAnnotatedInHierarchy(psiClass, CUSTOM_TESTABLE_ANNOTATION_LIST)) { return true; } if (!PsiClassUtil.isRunnableClass(psiClass, false, checkAbstract)) return false; return CachedValuesManager.getCachedValue(psiClass, () -> { boolean hasAnnotation = AnnotationUtil.isAnnotated(psiClass, "org.junit.jupiter.api.extension.ExtendWith", 0); if (!hasAnnotation) { for (final PsiMethod method : psiClass.getAllMethods()) { ProgressManager.checkCanceled(); if (!method.hasModifierProperty(PsiModifier.PRIVATE) && !method.hasModifierProperty(PsiModifier.STATIC) && MetaAnnotationUtil.isMetaAnnotated(method, CUSTOM_TESTABLE_ANNOTATION_LIST)) { hasAnnotation = true; break; } } } if (!hasAnnotation) { for (PsiClass aClass : psiClass.getAllInnerClasses()) { if (!aClass.hasModifierProperty(PsiModifier.PRIVATE) && !aClass.hasModifierProperty(PsiModifier.STATIC) && MetaAnnotationUtil.isMetaAnnotated(aClass, Collections.singleton(JUNIT5_NESTED))) { hasAnnotation = true; break; } } } return CachedValueProvider.Result.create(hasAnnotation, PsiModificationTracker.MODIFICATION_COUNT); }); }