public void testRollback() throws CacheLoaderException {
cs.store(TestInternalCacheEntryFactory.create("old", "old"));
List<Modification> mods = new ArrayList<Modification>();
mods.add(new Store(TestInternalCacheEntryFactory.create("k1", "v1")));
mods.add(new Store(TestInternalCacheEntryFactory.create("k2", "v2")));
mods.add(new Remove("k1"));
mods.add(new Remove("old"));
GlobalTransaction tx = gtf.newGlobalTransaction(null, false);
cs.prepare(mods, tx, false);
assert !cs.containsKey("k1");
assert !cs.containsKey("k2");
assert cs.containsKey("old");
cs.rollback(tx);
assert !cs.containsKey("k1");
assert !cs.containsKey("k2");
assert cs.containsKey("old");
mods = new ArrayList<Modification>();
mods.add(new Store(TestInternalCacheEntryFactory.create("k1", "v1")));
mods.add(new Store(TestInternalCacheEntryFactory.create("k2", "v2")));
mods.add(new Clear());
mods.add(new Store(TestInternalCacheEntryFactory.create("k3", "v3")));
cs.prepare(mods, tx, false);
assert !cs.containsKey("k1");
assert !cs.containsKey("k2");