void () { final PsiManagerEx psiManager = PsiManagerEx.getInstanceEx(getProject()); GlobalSearchScope scope = GlobalSearchScope.allScope(getProject()); final VirtualFile file = addFileToProject("foo/Foo.java", "package foo; class Foo {}").getVirtualFile(); assertNotNull(JavaPsiFacade.getInstance(getProject()).findClass("foo.Foo", scope)); long count1 = getTracker().getModificationCount(); long hc = psiManager.findFile(file).hashCode(); long stamp1 = psiManager.findFile(file).getModificationStamp(); rename(file, "Bar.java"); assertNotNull(JavaPsiFacade.getInstance(getProject()).findClass("foo.Foo", scope)); assertTrue(String.valueOf(count1), count1 != getTracker().getModificationCount()); assertTrue(String.valueOf(stamp1), stamp1 != psiManager.findFile(file).getModificationStamp()); assertEquals(hc, psiManager.findFile(file).hashCode()); }