MemoizationDefaults { public static <T, U> BiFunction<T, U, String> hashCodeKeyFunction() { return (first, second) -> { final int firstHashCode = Objects.hashCode(first); final int secondHashCode = Objects.hashCode(second); return firstHashCode + " " + secondHashCode; }; } private  MemoizationDefaults(); static Supplier<String> defaultKeySupplier(); static BiFunction<T, U, String> hashCodeKeyFunction(); static ObjDoubleFunction<INPUT, String> objDoubleConsumerHashCodeKeyFunction(); static ObjIntFunction<INPUT, String> objIntConsumerHashCodeKeyFunction(); static ObjLongFunction<INPUT, String> objLongConsumerHashCodeKeyFunction(); static DoubleBinaryFunction<String> doubleBinaryOperatorHashCodeKeyFunction(); static IntBinaryFunction<String> intBinaryOperatorHashCodeKeyFunction(); static LongBinaryFunction<String> longBinaryOperatorHashCodeKeyFunction();  }
@Test public void shouldDefineHashCodeKeyFunction() { BiFunction<Object, Object, String> keyFunction; keyFunction = MemoizationDefaults.hashCodeKeyFunction(); Assert.assertNotNull("Default key function is NULL", keyFunction); }
@Test public void shouldConcatHashCodesWithWhitespaceInbetween() { final BiFunction<Object, Object, String> keyFunction = MemoizationDefaults.hashCodeKeyFunction(); final String calculatedKey = keyFunction.apply(Integer.valueOf(1), Integer.valueOf(2)); Assert.assertEquals("Calculated key does not match expectations", "1 2", calculatedKey); }