BucketTargetingMap extends AbstractMap<K, V> { @Override public V get(final Object key) { return region.get(key, callbackArg); } BucketTargetingMap(BucketRegion region, int bucketId); @Override Set<K> keySet(); @Override V putIfAbsent(final K key, final V value); @Override V get(final Object key); @Override V remove(final Object key); @Override boolean containsKey(final Object key); @Override V put(final K key, final V value); @Override Set<Entry<K, V>> entrySet(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); public Object callbackArg; }
@Test public void getUsesCallbackArg() { final BucketTargetingMap map = new BucketTargetingMap(region, 1); when(region.get(eq("key"), eq(1))).thenReturn("value"); assertEquals("value", map.get("key")); }