void () { myFixture.addClass("package junit.framework; public class TestCase {}"); PsiFile file = myFixture.configureByText("Foo.java", """ public class Foo extends junit.framework.TestCase { public class Bar extends Foo { public void testFoo() { } } public void testFoo2() { } }"""); PsiClass aClass = ((PsiClassOwner)file).getClasses()[0]; TestFramework framework = TestFrameworks.detectFramework(aClass); assertNotNull(framework); assertTrue(framework.isTestClass(aClass)); PsiClass innerClass = aClass.getInnerClasses()[0]; assertFalse(framework.isTestClass(innerClass)); }