void () { final VirtualFile file = addFileToProject("Foo.java", "class Foo {}").getVirtualFile(); assertNotNull(JavaPsiFacade.getInstance(getProject()).findClass("Foo", GlobalSearchScope.allScope(getProject()))); long count1 = getJavaTracker().getModificationCount(); gcPsiAndDocument(file); setFileText(file, ""); assertNull(FileDocumentManager.getInstance().getCachedDocument(file)); assertNull(JavaPsiFacade.getInstance(getProject()).findClass("Foo", GlobalSearchScope.allScope(getProject()))); assertFalse(count1 == getJavaTracker().getModificationCount()); }