public void testSkipCacheFlagUsage() throws PersistenceException {
CountingStore countingCS = getCountingCacheStore();
store.write(new MarshalledEntryImpl("k1", "v1", null, marshaller(cache)));
assert countingCS.numLoads == 0;
assert countingCS.numContains == 0;
//load using SKIP_CACHE_STORE should not find the object in the store
assert cache.getAdvancedCache().withFlags(Flag.SKIP_CACHE_STORE).get("k1") == null;
assert countingCS.numLoads == 0;
assert countingCS.numContains == 0;
// counter-verify that the object was actually in the store:
assert "v1".equals(cache.get("k1"));
assert countingCS.numLoads == 1 : "Expected 1, was " + countingCS.numLoads;
assert countingCS.numContains == 0 : "Expected 0, was " + countingCS.numContains;
// now check that put won't return the stored value
store.write(new MarshalledEntryImpl("k2", "v2", null, marshaller(cache)));
Object putReturn = cache.getAdvancedCache().withFlags(Flag.SKIP_CACHE_STORE).put("k2", "v2-second");
assert putReturn == null;
assert countingCS.numLoads == 1 : "Expected 1, was " + countingCS.numLoads;
assert countingCS.numContains == 0 : "Expected 0, was " + countingCS.numContains;
// but it inserted it in the cache: