void () { @Language("JAVA") String text = """ abstract class AF<caret>oo{ abstract boolean aaa(); static class AFoo1 extends AFoo { @Override boolean aaa() { return false; } } static class AFoo3 extends AFoo { @Override boolean aaa() { return false; } } static class AFoo2 extends AFoo { @Override boolean aaa() { return false; } } \s }"""; myFixture.configureByText("a.java", text); PsiClass psiClass = (PsiClass)TargetElementUtil.findTargetElement(myFixture.getEditor(), TargetElementUtil.getInstance().getAllAccepted()); assert psiClass != null; final Collection<PsiElement> classes = getClassImplementations(psiClass); List<PsiElement> all = new ArrayList<>(); all.add(psiClass); all.addAll(classes); final ImplementationViewComponent component = createImplementationView(all); try { final String[] visibleFiles = component.getVisibleFiles(); assertTrue(visibleFiles.length > 0); assertEquals("AFoo", visibleFiles[0]); Arrays.sort(visibleFiles); Assert.assertArrayEquals(Arrays.toString(visibleFiles), new String[]{"AFoo", "AFoo1 in AFoo", "AFoo2 in AFoo", "AFoo3 in AFoo"}, visibleFiles); } finally { component.removeNotify(); } }