ConcurrentMapBasedBiFunctionMemoizer extends ConcurrentMapBasedMemoizer<KEY, VALUE> implements MemoizingBiFunction<FIRST, SECOND, KEY, VALUE> { @Override public BiFunction<FIRST, SECOND, KEY> getKeyFunction() { return keyFunction; } @SuppressWarnings(CompilerWarnings.NLS)  ConcurrentMapBasedBiFunctionMemoizer(
            final ConcurrentMap<KEY, VALUE> cache,
            final BiFunction<FIRST, SECOND, KEY> keyFunction,
            final BiFunction<FIRST, SECOND, VALUE> biFunction); @Override BiFunction<FIRST, SECOND, KEY> getKeyFunction(); @Override BiFunction<FIRST, SECOND, VALUE> getBiFunction(); @Override BiFunction<KEY, Function<KEY, VALUE>, VALUE> getMemoizingFunction();  }
@Test public void shouldReturnGivenKeyFunction() { final ConcurrentMap<String, String> cache = new ConcurrentHashMap<>(); final BiFunction<String, String, String> keyFunction = (a, b) -> "key"; final BiFunction<String, String, String> biFunction = (a, b) -> "value"; final ConcurrentMapBasedBiFunctionMemoizer<String, String, String, String> memoizer = new ConcurrentMapBasedBiFunctionMemoizer<>( cache, keyFunction, biFunction); Assert.assertNotNull("Key function is NULL", memoizer.getKeyFunction()); Assert.assertSame("Key function is not the same", keyFunction, memoizer.getKeyFunction()); }