ExceptionUtil { public static RuntimeException unchecked(@Nullable Throwable t) { if (t instanceof RuntimeException) { throw (RuntimeException) t; } if (t instanceof Error) { throw (Error) t; } throw new UncheckedException(t); }  static RuntimeException unchecked(@Nullable Throwable t); static Throwable unwrap(@Nullable Throwable t); static RuntimeException unwrapAndUnchecked(@Nullable Throwable t); static String stackTraceText(@NotNull Throwable t); static String toStringWithShortName(@Nullable Throwable t); static String toStringWithRootCause(@Nullable Throwable t); static Throwable getRootCause(@NotNull Throwable t); static T findCause(@NotNull Throwable throwable, Class<T> cause); @SuppressWarnings("unchecked") static boolean isCausedBy(@Nullable Throwable throwable,
			Class<? extends Exception>... causeExceptionClasses); static T setStackTrace(@NotNull T throwable, Class<?> throwClass, String throwClazz); static T clearStackTrace(@NotNull T throwable);  }
@Test public void unchecked() { Exception exception = new Exception("my exception"); try { ExceptionUtil.unchecked(exception); fail("should fail before"); } catch (Throwable t) { assertThat(t.getCause()).isSameAs(exception); } Error error = new LinkageError(); try { ExceptionUtil.unchecked(error); fail("should fail before"); } catch (Throwable t) { assertThat(t).isSameAs(error); } RuntimeException runtimeException = new RuntimeException("haha"); try { ExceptionUtil.unchecked(runtimeException); fail("should fail before"); } catch (Throwable t) { assertThat(t).isSameAs(runtimeException); } }