コード例 #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);
  }