@@ -0,0 +1,949 @@
+/**%0A *%0A * @author levisjani%0A */%0A%0Apublic class Demo %7B%0A   public static void main(String%5B%5D args) %7B%0A      Originator originator = new Originator();%0A      CareTaker careTaker = new CareTaker();%0A      originator.setState(%22State #1%22);%0A      originator.setState(%22State #2%22);%0A      careTaker.add(originator.saveStateToMemento());%0A      originator.setState(%22State #3%22);%0A      careTaker.add(originator.saveStateToMemento());%0A      originator.setState(%22State #4%22);%0A%0A      System.out.println(%22Current State from originator: %22 + originator.getState());%09%09%0A      originator.getStateFromMemento(careTaker.get());%0A      System.out.println(%22First saved State: %22 + originator.getState());%0A      originator.getStateFromMemento(careTaker.get());%0A      System.out.println(%22Second saved State: %22 + originator.getState());%0A      /* originator.getStateFromMemento(careTaker.get(2));%0A      System.out.println(%22Third saved State: %22 + originator.getState()); %0A      */ %0A   %7D%0A%7D%0A

Create Demo.java