void () { Collection<PsiFileImpl> roots = myRoots.values(); PsiDocumentManager documentManager = PsiDocumentManager.getInstance(getManager().getProject()); documentManager.commitAllDocuments(); for (PsiFile root : roots) { Document document = documentManager.getDocument(root); assert document != null; PsiDocumentManagerBase.checkConsistency(root, document); assert root.getText().equals(document.getText()); } }