Exemplo n.º 1
0
  @Test
  public void testBiFuncInPlace() {

    assertThat(
        Curry.curry2((Integer i, Integer j) -> "" + (i + j) + "hello").apply(1).apply(2),
        equalTo("3hello"));
  }
Exemplo n.º 2
0
  @Test
  public void testMethodRef() {

    assertThat(Curry.curry2(this::mult).apply(3).apply(2), equalTo(6));
  }
Exemplo n.º 3
0
  @Test
  public void testBiFunc() {

    BiFunction<Integer, Integer, String> fn = (i, j) -> "" + (i + j) + "hello";
    assertThat(Curry.curry2(fn).apply(1).apply(2), equalTo("3hello"));
  }