Пример #1
0
  @Test
  public void testCheckedIntToDoubleFunction() {
    IntToDoubleFunction test =
        Unchecked.intToDoubleFunction(
            i -> {
              throw new Exception("" + i);
            });

    assertIntToDoubleFunction(test, RuntimeException.class);
  }
Пример #2
0
  @Test
  public void testCheckedIntToDoubleFunctionWithCustomHandler() {
    IntToDoubleFunction test =
        Unchecked.intToDoubleFunction(
            i -> {
              throw new Exception("" + i);
            },
            e -> {
              throw new IllegalStateException(e);
            });

    assertIntToDoubleFunction(test, IllegalStateException.class);
  }