boolean (final PsiClass psiClass, boolean checkAbstract) { final PsiModifierList modifierList = psiClass.getModifierList(); if (modifierList == null) return false; if (psiClass.getQualifiedName() == null) return false; //skip local and anonymous classes if (JavaPsiFacade.getInstance(psiClass.getProject()) .findClass(TEST_ANNOTATION, psiClass.getResolveScope()) == null) { return false; } PsiClass topLevelClass = getTopmostClass(psiClass); if (topLevelClass != null) { if (AnnotationUtil.isAnnotated(topLevelClass, RUN_WITH, CHECK_HIERARCHY)) { PsiAnnotation annotation = getRunWithAnnotation(topLevelClass); if (topLevelClass == psiClass) { return true; } if (AnnotationUtil.isAnnotated(psiClass, RUN_WITH, CHECK_HIERARCHY)) { return true; } //default runners do not implicitly run inner classes if (annotation != null && !isInheritorOrSelfRunner(annotation, RUNNERS_UNAWARE_OF_INNER_CLASSES)) { return true; } } } if (!hasNonPrivateConstructor(psiClass)) return false; if (!PsiClassUtil.isRunnableClass(psiClass, true, checkAbstract)) return false; for (final PsiMethod method : psiClass.getAllMethods()) { ProgressManager.checkCanceled(); if (TestUtils.isExplicitlyJUnit4TestAnnotated(method) || JUnitRecognizer.willBeAnnotatedAfterCompilation(method)) return true; } return false; }