### Question:
ExceptionUtils { public static <T> T propagate(final Callable<T> callable) { return propagate(callable, RuntimeException::new); } private  ExceptionUtils(); static void propagateVoid(final CheckedRunnable runnable); static void propagateVoid(
      final CheckedRunnable runnable, final Function<Exception, E> wrap); static T propagate(final Callable<T> callable); static T propagate(
      final Callable<T> callable, final Function<Exception, E> wrap);  }### Answer:
@Test public void propagateReturnsResultOnSuccess() { final int result = ExceptionUtils.propagate(() -> 7); MatcherAssert.assertThat(result, IsEqual.equalTo(7)); }
@Test public void propagateAllowsRuntimeExceptionsToPropagate() { Assertions.assertThrows( IllegalArgumentException.class, () -> ExceptionUtils.propagate( () -> { throw new IllegalArgumentException(); })); }
@Test public void propagateWrapsCheckedExceptionsInRuntimeExceptionByDefault() { Assertions.assertThrows( RuntimeException.class, () -> ExceptionUtils.propagate( () -> { throw new IOException(); })); }
@Test public void propagateCanWrapCheckedExceptionsInCustomRuntimeException() { Assertions.assertThrows( IllegalArgumentException.class, () -> ExceptionUtils.propagate( () -> { throw new IOException(); }, IllegalArgumentException::new)); }
@Test public void propagateUnwrapsUncheckedExecutionExceptions() { Assertions.assertThrows( IllegalArgumentException.class, () -> ExceptionUtils.propagate( () -> { throw new MockExecutionException(new IllegalArgumentException()); })); }
@Test public void propagateWrapsCheckedExecutionExceptionsInRuntimeExceptionByDefault() { Assertions.assertThrows( RuntimeException.class, () -> ExceptionUtils.propagate( () -> { throw new MockExecutionException(new IOException()); })); }
@Test public void propagateCanWrapCheckedExecutionExceptionsInCustomRuntimeException() { Assertions.assertThrows( IllegalArgumentException.class, () -> ExceptionUtils.propagate( () -> { throw new MockExecutionException(new IOException()); }, IllegalArgumentException::new)); }
@Test public void propagateMapsInterruptedExceptionToIllegalStateException() throws InterruptedException { final InterruptedExceptionTestRunner runner = new InterruptedExceptionTestRunner( () -> ExceptionUtils.propagate( () -> { Thread.sleep(1000); return null; })); runner.run(); MatcherAssert.assertThat(runner.getUnhandledException(), IsNull.notNullValue()); MatcherAssert.assertThat( runner.getUnhandledException(), IsInstanceOf.instanceOf(IllegalStateException.class)); }