void () { PsiFileGist<Integer> gist = psiGistReturningCalculationsCount(); PsiFile file = myFixture.addFileToProject("a.xtt", "foo"); assert gist.getFileData(file) == 1; GCWatcher.tracking(PsiDocumentManager.getInstance(getProject()).getCachedDocument(file)).ensureCollected(); assert PsiDocumentManager.getInstance(getProject()).getCachedDocument(file) == null; assert gist.getFileData(file) == 1; assert PsiDocumentManager.getInstance(getProject()).getCachedDocument(file) == null; }