void () { moveCaret(1, RIGHT, false); final Document doc = EditorFactory.getInstance().createDocument("Some another document"); executeTransparently(() -> WriteCommandAction.runWriteCommandAction(null, () -> doc.deleteString(0, 5))); moveCaret(1, LEFT, false); typeInChar('c'); undoFirstEditor(); checkEditorState("test", 0, 0, 0); }