@@ -0,0 +1,647 @@
+import java.util.List;%0Aimport java.util.ArrayList;%0A%0Aclass Caretaker %7B%0A    public static void main(String%5B%5D args) %7B%0A        List%3COriginator.Memento%3E savedStates = new ArrayList%3COriginator.Memento%3E();%0A %0A        Originator originator = new Originator();%0A        originator.set(%22State1%22);%0A        originator.set(%22State2%22);%0A        savedStates.add(originator.saveToMemento());%0A        originator.set(%22State3%22);%0A        // We can request multiple mementos, and choose which one to roll back to.%0A        savedStates.add(originator.saveToMemento());%0A        originator.set(%22State4%22);%0A %0A        originator.restoreFromMemento(savedStates.get(1));  %0A    %7D%0A%7D%0A

Create Caretaker.java