void () { VirtualFile file = myFixture.configureByFiles("Bar.java", "Foo.java")[1].getVirtualFile(); rebuildProject(); assertSize(2, getReferentFilesForElementUnderCaret()); myFixture.renameElement(getPsiManager().findFile(file), "Foo.txt"); assertEquals("Bar.java", assertOneElement(getReferentFilesForElementUnderCaret()).getName()); }