예제 #1
0
  @Test
  public void testCheckedToIntFunction() {
    ToIntFunction<Object> test =
        Unchecked.toIntFunction(
            t -> {
              throw new Exception("" + t);
            });

    assertToIntFunction(test, RuntimeException.class);
  }
예제 #2
0
  @Test
  public void testCheckedToIntFunctionWithCustomHandler() {
    ToIntFunction<Object> test =
        Unchecked.toIntFunction(
            t -> {
              throw new Exception("" + t);
            },
            e -> {
              throw new IllegalStateException(e);
            });

    assertToIntFunction(test, IllegalStateException.class);
  }