void () { myFixture.configureByFiles("Foo.java", "Bar.java", "Baz.java", "FooImpl.java"); rebuildProject(); final Set<VirtualFile> referents = getReferentFilesForElementUnderCaret(); assertNotNull(referents); final Set<String> filesWithReferences = referents.stream().map(VirtualFile::getName).collect(Collectors.toSet()); assertEquals(filesWithReferences, Set.of("Baz.java", "Foo.java", "FooImpl.java")); myFixture.addFileToProject("SomeModification.java", ""); assertNull(getReferentFilesForElementUnderCaret()); }