public class MementoPattern {
public static void main(String[] args) {
Originator o = new Originator();
o.SetState("ON");
o.Show();
Caretaker c = new Caretaker();
c.SetMemento(o.CreateMemento());
o.SetState("OFF");
o.Show();
o.SetMemento(c.GetMemento());
o.Show();
}
}