コード例 #1
0
  @Test
  public void testCheckedIntToLongFunction() {
    IntToLongFunction test =
        Unchecked.intToLongFunction(
            i -> {
              throw new Exception("" + i);
            });

    assertIntToLongFunction(test, RuntimeException.class);
  }
コード例 #2
0
  @Test
  public void testCheckedIntToLongFunctionWithCustomHandler() {
    IntToLongFunction test =
        Unchecked.intToLongFunction(
            i -> {
              throw new Exception("" + i);
            },
            e -> {
              throw new IllegalStateException(e);
            });

    assertIntToLongFunction(test, IllegalStateException.class);
  }