void () { final VirtualFile vFile = myFixture.addClass("class Foo {}").getContainingFile().getVirtualFile(); PsiFileWithStubSupport psiFile = (PsiFileWithStubSupport)getPsiManager().findFile(vFile); assertNotNull(psiFile); PsiClass clazz = findClass("Foo"); assertNotNull(clazz); int stubTreeHash = psiFile.getStubTree().hashCode(); GCUtil.tryGcSoftlyReachableObjects(); StubTree stubTree = psiFile.getStubTree(); assertNotNull(stubTree); assertEquals(stubTreeHash, stubTree.hashCode()); }