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