void (@NotNull Command command) { Editor editor = getFirstEditor(); executeCommand(() -> typeInText("a")); String afterType1 = editor.getDocument().getText(); executeCommand(() -> typeInText("b")); String afterType2 = editor.getDocument().getText(); undo(editor); checkEditorText(afterType1, editor); executeTransparently(command); assertUndoIsAvailable(editor); assertRedoIsAvailable(editor); redo(editor); checkEditorText(afterType2, editor); assertUndoIsAvailable(editor); assertRedoNotAvailable(editor); undo(editor); checkEditorText(afterType1, editor); assertUndoIsAvailable(editor); assertRedoIsAvailable(editor); redo(editor); checkEditorText(afterType2, editor); assertUndoIsAvailable(editor); assertRedoNotAvailable(editor); }