void () { myFixture.configureByFiles("Foo.java", "FooImpl.java", "Bar.java", "Baz.java", "Test.java"); rebuildProject(); CompilerDirectHierarchyInfo directInheritorInfo = getHierarchyForElementUnderCaret(); Collection<PsiClass> inheritors = directInheritorInfo.getHierarchyChildren().map(PsiClass.class::cast).collect(Collectors.toList()); assertSize(6, inheritors); for (PsiClass inheritor : inheritors) { if (inheritor instanceof PsiAnonymousClass) { assertOneOf(inheritor.getTextOffset(), 58, 42, 94); } else { assertOneOf(inheritor.getName(), "FooImpl", "FooImpl2", "FooInsideMethodImpl"); } } }