MemoizationDefaults { public static <INPUT> ObjDoubleFunction<INPUT, String> objDoubleConsumerHashCodeKeyFunction() { return (first, second) -> { final int firstHashCode = Objects.hashCode(first); final int secondHashCode = Double.valueOf(second).hashCode(); 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 shouldDefineObjDoubleConsumerHashCodeKeyFunction() { ObjDoubleFunction<Object, String> keyFunction; keyFunction = MemoizationDefaults.objDoubleConsumerHashCodeKeyFunction(); Assert.assertNotNull("Default key function is NULL", keyFunction); }
@Test public void shouldConcatObjDoubleConsumerHashCodesWithWhitespaceInbetween() { final ObjDoubleFunction<Object, String> keyFunction = MemoizationDefaults .objDoubleConsumerHashCodeKeyFunction(); final String calculatedKey = keyFunction.apply(Integer.valueOf(1), 123.456D); Assert.assertEquals("Calculated key does not match expectations", "1 1522623320", calculatedKey); }