@Test
public void testMemoizeLast() {

    Function<String, String> evaluator = Evaluators.memoizeLast(s -> {
        counter++;
        return ("" + s).toUpperCase();
    });
    assertThat(evaluator.apply("a")).isEqualTo("A");
    assertThat(evaluator.apply("a")).isEqualTo("A");
    assertThat(counter).isEqualTo(1);
    assertThat(evaluator.apply(null)).isEqualTo("NULL");
    assertThat(evaluator.apply(null)).isEqualTo("NULL");
    assertThat(counter).isEqualTo(2);
    assertThat(evaluator.apply("b")).isEqualTo("B");
    assertThat(evaluator.apply("b")).isEqualTo("B");
    assertThat(counter).isEqualTo(3);
}