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

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

    assertToLongFunction(test, IllegalStateException.class);
  }