void () { myFixture.addClass("package pkg; public interface I {void m();}"); PsiFileImpl anotherFile = (PsiFileImpl)myFixture.addFileToProject("pkg2/Another.java", "class Another implements pkg.I {public void m() {}}"); myFixture.configureByText("a.java", "class Foo implements pkg.I {public void m<caret>(){}}"); PsiMethod method = PsiTreeUtil.getParentOfType(getFile().findElementAt(getEditor().getCaretModel().getOffset()), PsiMethod.class); PsiMethod superMethod = method.findDeepestSuperMethods()[0]; assertNull(anotherFile.derefStub()); assertFalse(anotherFile.isContentsLoaded()); assertOneElement(OverridingMethodsSearch.search(superMethod, new LocalSearchScope(getFile()), true).findAll()); // check we didn't go to another file during search assertNull(anotherFile.derefStub()); assertFalse(anotherFile.isContentsLoaded()); }