### Question:
Exceptions { public static void propagateIfFatal(Throwable throwable) { if (throwable instanceof InterruptedException) { throw new RuntimeInterruptedException((InterruptedException) throwable); } else if (throwable instanceof RuntimeInterruptedException) { Thread.currentThread().interrupt(); throw (RuntimeInterruptedException) throwable; } else if (throwable instanceof Error) { throw (Error) throwable; } }  static boolean isPrefixBoring(Throwable t); static RuntimeException propagate(Throwable throwable); static RuntimeException propagate(String msg, Throwable throwable); static void propagateIfFatal(Throwable throwable); @SuppressWarnings("unchecked") static T getFirstThrowableOfType(Throwable from, Class<T> clazz); static Throwable getFirstThrowableMatching(Throwable from, Predicate<? super Throwable> filter); static Throwable getFirstInteresting(Throwable throwable); static Throwable collapse(Throwable source); static Throwable collapseIncludingAllCausalMessages(Throwable source); static Throwable collapse(Throwable source, boolean collapseCausalChain); static RuntimeException propagateCollapsed(Throwable source); static String collapseText(Throwable t); static String collapseTextIncludingAllCausalMessages(Throwable t); static RuntimeException propagate(Collection<? extends Throwable> exceptions); static RuntimeException propagate(String prefix, Collection<? extends Throwable> exceptions); static Throwable create(Collection<? extends Throwable> exceptions); static RuntimeException create(@Nullable String prefix, Collection<? extends Throwable> exceptions); static boolean isPrefixImportant(Throwable t); static String getPrefixText(Throwable t);  }### Answer:
@Test public void testPropagateIfFatalPropagatesInterruptedException() throws Exception { InterruptedException tothrow = new InterruptedException("simulated"); try { Exceptions.propagateIfFatal(tothrow); fail(); } catch (RuntimeException e) { assertTrue(Thread.interrupted()); assertEquals(e.getCause(), tothrow); } }
@Test public void testPropagateIfFatalPropagatesRuntimeInterruptedException() throws Exception { RuntimeInterruptedException tothrow = new RuntimeInterruptedException(new InterruptedException("simulated")); try { Exceptions.propagateIfFatal(tothrow); fail(); } catch (RuntimeInterruptedException e) { assertTrue(Thread.interrupted()); assertEquals(e, tothrow); } }
@Test public void testPropagateIfFatalPropagatesError() throws Exception { Error tothrow = new Error(); try { Exceptions.propagateIfFatal(tothrow); fail(); } catch (Error e) { assertEquals(e, tothrow); } }
@Test public void testPropagateIfFatalDoesNotPropagatesNormalException() throws Exception { Exception e = new Exception(); Exceptions.propagateIfFatal(e); RuntimeException re = new RuntimeException(); Exceptions.propagateIfFatal(re); Throwable t = new Throwable(); Exceptions.propagateIfFatal(t); }