Esempio n. 1
0
  @Test
  public void testMethodRef5() {

    assertThat(
        Curry.curry5(this::five).apply(3).apply(2).apply("three").apply("4").apply(true),
        equalTo("three64true"));
  }
Esempio n. 2
0
  @Test
  public void testMethodRef6() {

    assertThat(
        Curry.curry6(this::six).apply(3).apply(2).apply("three").apply("4").apply(true).apply(10),
        equalTo("three164true"));
  }
Esempio n. 3
0
  @Test
  public void testBiFuncInPlace() {

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

    assertThat(
        Curry.curry7(this::seven)
            .apply(3)
            .apply(2)
            .apply("three")
            .apply("4")
            .apply(true)
            .apply(10)
            .apply("prefix"),
        equalTo("prefixthree164true"));
  }
Esempio n. 5
0
  @Test
  public void testMethodRef8() {

    assertThat(
        Curry.curry8(this::eight)
            .apply(3)
            .apply(2)
            .apply("three")
            .apply("4")
            .apply(true)
            .apply(10)
            .apply("prefix")
            .apply(false),
        equalTo("falseprefixthree164true"));
  }
Esempio n. 6
0
  @Test
  public void testMethodRef4() {

    assertThat(
        Curry.curry4(this::four).apply(3).apply(2).apply("three").apply("4"), equalTo("three64"));
  }
Esempio n. 7
0
  @Test
  public void testMethodRef3() {

    assertThat(Curry.curry3(this::three).apply(3).apply(2).apply("three"), equalTo("three6"));
  }
Esempio n. 8
0
  @Test
  public void testMethodRef() {

    assertThat(Curry.curry2(this::mult).apply(3).apply(2), equalTo(6));
  }
Esempio n. 9
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"));
  }