@Test void testPassthroughCache() { final List<String> list = new CopyOnWriteArrayList<>(); final Function<String, String> mapper = key -> { list.add(key); return key + "-some-suffix"; }; final CacheService<String, String> cache = new NoopCacheService<>(); assertEquals("one-some-suffix", cache.get("one", mapper), "Cache mapper didn't handle 'one'"); assertEquals("two-some-suffix", cache.get("two", mapper), "Cache mapper didn't handle 'two'"); assertEquals("one-some-suffix", cache.get("one", mapper), "Cache mapper didn't handle 'one'"); assertEquals(3L, list.size(), "Cache calls didn't match the internal record-keeping!"); }
@Override public V get(final K key, final Function<K, V> mappingFunction) { return mappingFunction.apply(key); }
NoopCacheService implements CacheService<K, V> { @Override public V get(final K key, final Function<K, V> mappingFunction) { return mappingFunction.apply(key); } }
NoopCacheService implements CacheService<K, V> { @Override public V get(final K key, final Function<K, V> mappingFunction) { return mappingFunction.apply(key); }  }
NoopCacheService implements CacheService<K, V> { @Override public V get(final K key, final Function<K, V> mappingFunction) { return mappingFunction.apply(key); }  @Override V get(final K key, final Function<K, V> mappingFunction); }
NoopCacheService implements CacheService<K, V> { @Override public V get(final K key, final Function<K, V> mappingFunction) { return mappingFunction.apply(key); }  @Override V get(final K key, final Function<K, V> mappingFunction);  }