### Question:
Boilerplate { public static RuntimeException rethrow(Throwable t) { return Throwables.propagate(t); }  static RuntimeException rethrow(Throwable t); static String toString(Class<?> clazz, Object... fields);  }### Answer:
@Test public void rethrow_wraps_checked_exceptions_before_rethrowing_them() { Exception e = new IOException("foo"); thrown.expect(RuntimeException.class); thrown.expectCause(equalTo(e)); Boilerplate.rethrow(e); }
@Test public void rethrow_rethrows_unchecked_exceptions_as_is() { Exception e = new IllegalArgumentException("foo"); thrown.expect(equalTo(e)); Boilerplate.rethrow(e); }