void () { getFirstEditor().getCaretModel().moveToOffset(getFirstEditor().getDocument().getTextLength()); typeInChar(' '); moveCaret(LEFT, false); executeTransparentlyInWriteAction(() -> getFirstEditor().getDocument().insertString(0, " ")); executeTransparentlyInWriteAction(() -> getSecondEditor().getDocument().insertString(0, " ")); delete(getFirstEditor()); checkEditorText(" test"); while (isUndoAvailable(getFirstEditor())) undo(getFirstEditor()); checkEditorText("test"); while (isRedoAvailable(getFirstEditor())) redo(getFirstEditor()); checkEditorText(" test"); }