@Test public void testCheckedToIntFunction() { ToIntFunction<Object> test = Unchecked.toIntFunction( t -> { throw new Exception("" + t); }); assertToIntFunction(test, RuntimeException.class); }
@Test public void testCheckedToIntFunctionWithCustomHandler() { ToIntFunction<Object> test = Unchecked.toIntFunction( t -> { throw new Exception("" + t); }, e -> { throw new IllegalStateException(e); }); assertToIntFunction(test, IllegalStateException.class); }