source: class StackWizardSettingsTest {
  
     @Test
     public void testRollBack() {
  
target:       WizardSettings s = new StackWizardSettings();
  
        final String key1 = "key1";
        final String key2 = "key2";
        final String key3 = "key3";
        final String value1 = "value1";
        final String value2 = "value2";
        final String value3 = "value3";
        final String value4 = "value4";
        
        final String page1 = "page1";
        final String page2 = "page2";
        
        s.newPage(page1);
        s.put(key1, value1);
        s.put(key2, value2);
        
        s.newPage(page2);
        s.put(key3, value3);
        // key 1 should still be the same as on Page1:
        Assert.assertEquals("Wrong value", s.get(key1), value1);
        
        s.put(key1, value4);
        Assert.assertEquals("Wrong value", s.get(key1), value4);
        // make sure key 2 is still visible:
        Assert.assertEquals("Wrong value", s.get(key2), value2);
        
        // key3 should now be visible:
        Assert.assertEquals("Wrong value", s.get(key3), value3);
        
        s.rollBack();
        // page2 keys should not have any effect:
        Assert.assertNull("key should not exist", s.get(key3));
        
        Assert.assertEquals("Wrong value", s.get(key1), value1);
        Assert.assertEquals("Wrong value", s.get(key2), value2);
        
     }
  
  }