예제 #1
0
  @Test
  public void testCheckedLongToIntFunction() {
    LongToIntFunction test =
        Unchecked.longToIntFunction(
            l -> {
              throw new Exception("" + l);
            });

    assertLongToIntFunction(test, RuntimeException.class);
  }
예제 #2
0
  @Test
  public void testCheckedLongToIntFunctionWithCustomHandler() {
    LongToIntFunction test =
        Unchecked.longToIntFunction(
            l -> {
              throw new Exception("" + l);
            },
            e -> {
              throw new IllegalStateException(e);
            });

    assertLongToIntFunction(test, IllegalStateException.class);
  }