void () { FileDocumentManager dm = FileDocumentManager.getInstance(); EditorFactory ef = EditorFactory.getInstance(); VirtualFile f = createChildData(myRoot, "f.java"); Document d = dm.getDocument(f); Editor e = ef.createEditor(d); assertEquals("", d.getText()); typeInText(e, "12345"); assertEquals("12345", d.getText()); dm.saveDocument(d); undo(e); ef.releaseEditor(e); assertEquals("", d.getText()); }