}
public void testWithFlags() {
AdvancedCache<String, String> localCache1 = cache1.getAdvancedCache().withFlags(Flag.CACHE_MODE_LOCAL);
AdvancedCache<String, String> localCache2 = cache2.getAdvancedCache().withFlags(Flag.CACHE_MODE_LOCAL);
TreeCache<String, String> treeCache1 = new TreeCacheFactory().createTreeCache(localCache1);
TreeCache<String, String> treeCache2 = new TreeCacheFactory().createTreeCache(localCache2);
final Fqn fqn = Fqn.fromElements("TEST_WITH_FLAGS");
treeCache1.put(fqn, KEY, "1");
treeCache2.put(fqn, KEY, "2");
assert "2".equals(treeCache2.get(fqn, KEY)) : "treeCache2 was updated locally";
assert "1".equals(treeCache1.get(fqn, KEY)) : "treeCache1 should not be invalidated in case of LOCAL put in treeCache2";