This is example code for my Habrahabr post https://habrahabr.ru/post/277245/ . The article explains how to use Command pattern to implement Undo/Redo functionality.