public static void putValuesOnMultimapCache(MultimapCache<String, Person> multimapCache, String key, Person... values) { for (int i = 0; i < values.length; i++) { await(multimapCache.put(key, values[i])); } }
<K> void doReturnViewFromReadOnlyEval(Supplier<K> keySupplier, ReadOnlyMap<K, String> ro, WriteOnlyMap<K, String> wo) { K k = keySupplier.get(); assertReadOnlyViewEmpty(k, await(ro.eval(k, identity()))); await(wo.eval(k, wv -> wv.set("one"))); assertReadOnlyViewEquals(k, "one", await(ro.eval(k, identity()))); }
<K> void doReturnViewFromReadWriteEval(Supplier<K> keySupplier, ReadWriteMap<K, String> readMap, ReadWriteMap<K, String> writeMap) { K k = keySupplier.get(); assertReadWriteViewEmpty(k, await(readMap.eval(k, returnReadWriteView()))); assertReadWriteViewEquals(k, "one", await(writeMap.eval(k, setOneReadWrite()))); assertReadWriteViewEquals(k, "one", await(readMap.eval(k, returnReadWriteView()))); assertReadWriteViewEquals(k, "uno", await(writeMap.eval(k, "uno", setValueReturnView()))); assertReadWriteViewEquals(k, "uno", await(readMap.eval(k, returnReadWriteView()))); }
public void testLocalUpdateSubsetAndReturnPrevs() { doUpdateSubsetAndReturnPrevs(supplyIntKey(), ro(fmapL1), wo(fmapL2), rw(fmapL2)); }
public void testLocalWriteConstantAndReadGetsValue() { doWriteConstantAndReadGetsValue(supplyIntKey(), ro(fmapL1), wo(fmapL2)); }
public void testLocalLambdaReadWriteListeners() throws Exception { doLambdaReadWriteListeners(supplyIntKey(), wo(fmapL1), rw(fmapL2), true); }
public void testLocalPutIfAbsent() { doPutIfAbsent(supplyIntKey(), local1, local2); }
public void testLocalReturnViewFromReadWriteEval() { doReturnViewFromReadWriteEval(supplyIntKey(), rw(fmapL1), rw(fmapL2)); }
@Override public Listeners.ReadWriteListeners<K, String> readWriteListeners() { return rw(fmap).listeners(); }
public void testLocalLambdaWriteListeners() throws Exception { doLambdaWriteListeners(supplyIntKey(), wo(fmapL1), true); }
public void testLocalReadOnlyEvalManyEmpty() { doReadOnlyEvalManyEmpty(supplyIntKey(), ro(fmapL1)); }
public void testReplReadOnlyEvalManyEmptyOnOwner() { doReadOnlyEvalManyEmpty(supplyKeyForCache(1, REPL), ro(fmapR1)); }
@Override public Listeners.WriteListeners<K, String> writeOnlyListeners() { return wo(fmap).listeners(); } }
public void testLocalWriteValueAndReadValueAndMetadata() { doWriteValueAndReadValueAndMetadata(supplyIntKey(), ro(fmapL1), wo(fmapL2)); }