ExceptionUtil { public static <T extends Throwable> T clearStackTrace(@NotNull T throwable) { Throwable cause = throwable; while (cause != null) { cause.setStackTrace(EMPTY_STACK_TRACE); cause = cause.getCause(); } return throwable; }  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 clearStackTrace() { IOException ioexception = new IOException("my exception"); RuntimeException runtimeException = new RuntimeException(ioexception); System.out.println(ExceptionUtil.stackTraceText(ExceptionUtil.clearStackTrace(runtimeException))); }