### Question:
Unchecked { public static RuntimeException propagate(Throwable throwable) { if (throwable instanceof InvocationTargetException) { throw propagate(((InvocationTargetException) throwable).getCause()); } else if (throwable instanceof IOException) { throw new UncheckedIOException((IOException) throwable); } else if (throwable instanceof ReflectiveOperationException) { throw new UncheckedReflectiveOperationException((ReflectiveOperationException) throwable); } else { Throwables.throwIfUnchecked(throwable); throw new RuntimeException(throwable); } } private  Unchecked(); static void wrap(CheckedRunnable block); static T wrap(CheckedSupplier<T> block); static Runnable runnable(CheckedRunnable runnable); static Function<T, R> function(CheckedFunction<T, R> function); static BiFunction<T, U, R> biFunction(CheckedBiFunction<T, U, R> function); static UnaryOperator<T> unaryOperator(CheckedUnaryOperator<T> function); static BinaryOperator<T> binaryOperator(CheckedBinaryOperator<T> function); static Predicate<T> predicate(CheckedPredicate<T> predicate); static BiPredicate<T, U> biPredicate(CheckedBiPredicate<T, U> predicate); static Consumer<T> consumer(CheckedConsumer<T> consumer); static BiConsumer<T, U> biConsumer(CheckedBiConsumer<T, U> consumer); static Supplier<R> supplier(CheckedSupplier<R> supplier); static RuntimeException propagate(Throwable throwable);  }### Answer:
@Test public void test_propagate() { Error error = new Error("a"); IllegalArgumentException argEx = new IllegalArgumentException("b"); IOException ioEx = new IOException("c"); URISyntaxException namingEx = new URISyntaxException("d", "e"); try { Unchecked.propagate(error); fail("Expected Error"); } catch (Error ex) { assertThat(ex).isSameAs(error); } try { Unchecked.propagate(argEx); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException ex) { assertThat(ex).isSameAs(argEx); } try { Unchecked.propagate(ioEx); fail("Expected UncheckedIOException"); } catch (UncheckedIOException ex) { assertThat(ex.getClass()).isEqualTo(UncheckedIOException.class); assertThat(ex.getCause()).isSameAs(ioEx); } try { Unchecked.propagate(namingEx); fail("Expected RuntimeException"); } catch (RuntimeException ex) { assertThat(ex.getClass()).isEqualTo(RuntimeException.class); assertThat(ex.getCause()).isSameAs(namingEx); } try { Unchecked.propagate(new InvocationTargetException(error)); fail("Expected Error"); } catch (Error ex) { assertThat(ex).isSameAs(error); } try { Unchecked.propagate(new InvocationTargetException(argEx)); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException ex) { assertThat(ex).isSameAs(argEx); } try { Unchecked.propagate(new InvocationTargetException(ioEx)); fail("Expected UncheckedIOException"); } catch (UncheckedIOException ex) { assertThat(ex.getClass()).isEqualTo(UncheckedIOException.class); assertThat(ex.getCause()).isSameAs(ioEx); } try { Unchecked.propagate(new InvocationTargetException(namingEx)); fail("Expected RuntimeException"); } catch (RuntimeException ex) { assertThat(ex.getClass()).isEqualTo(RuntimeException.class); assertThat(ex.getCause()).isSameAs(namingEx); } }