Ejemplo n.º 1
0
  @Test
  public void testCheckedFunction() {
    Function<Object, Object> test =
        Unchecked.function(
            t -> {
              throw new Exception("" + t);
            });

    assertFunction(test, RuntimeException.class);
  }
Ejemplo n.º 2
0
  @Test
  public void testCheckedFunctionWithCustomHandler() {
    Function<Object, Object> test =
        Unchecked.function(
            t -> {
              throw new Exception("" + t);
            },
            e -> {
              throw new IllegalStateException(e);
            });

    assertFunction(test, IllegalStateException.class);
  }