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