@Test
public void testMemoizeLastWithBiFunction() {

    AtomicInteger counter = new AtomicInteger(0);
    Function<String, Integer> timesCalled = Evaluators.memoizeLast((input, lastResult) -> counter.incrementAndGet());
    for (int i = 0; i < 5; i++) {
        assertThat(timesCalled.apply("foo")).isEqualTo(1);
    }
    for (int i = 0; i < 5; i++) {
        assertThat(timesCalled.apply("bar")).isEqualTo(2);
    }
    // no caching if inputs are different
    assertThat(timesCalled.apply("foo")).isEqualTo(3);
    assertThat(timesCalled.apply("bar")).isEqualTo(4);
}