@Test public void staticException() { assertThat(ExceptionUtil.stackTraceText(TIMEOUT_EXCEPTION)).hasLineCount(2) .contains("java.lang.RuntimeException: Timeout") .contains("at com.vip.vjtools.vjkit.base.ExceptionUtilTest.hello(Unknown Source)"); assertThat(ExceptionUtil.stackTraceText(TIMEOUT_EXCEPTION2)).hasLineCount(2) .contains("com.vip.vjtools.vjkit.base.type.CloneableException: Timeout") .contains("at com.vip.vjtools.vjkit.base.ExceptionUtilTest.hello(Unknown Source)"); CloneableException timeoutException = TIMEOUT_EXCEPTION2.clone("Timeout for 30ms"); assertThat(ExceptionUtil.stackTraceText(timeoutException)).hasLineCount(2) .contains("com.vip.vjtools.vjkit.base.type.CloneableException: Timeout for 30ms") .contains("at com.vip.vjtools.vjkit.base.ExceptionUtilTest.hello(Unknown Source)"); assertThat(ExceptionUtil.stackTraceText(TIMEOUT_EXCEPTION3)).hasLineCount(2) .contains("com.vip.vjtools.vjkit.base.type.CloneableRuntimeException: Timeout") .contains("at com.vip.vjtools.vjkit.base.ExceptionUtilTest.hello(Unknown Source)"); CloneableRuntimeException timeoutRuntimeException = TIMEOUT_EXCEPTION3.clone("Timeout for 40ms"); assertThat(ExceptionUtil.stackTraceText(timeoutRuntimeException)).hasLineCount(2) .contains("com.vip.vjtools.vjkit.base.type.CloneableRuntimeException: Timeout for 40ms") .contains("at com.vip.vjtools.vjkit.base.ExceptionUtilTest.hello(Unknown Source)"); }
public static String stackTraceText(@NotNull Throwable t) { StringBuilderWriter stringWriter = new StringBuilderWriter(); t.printStackTrace(new PrintWriter(stringWriter)); return stringWriter.toString(); }
ExceptionUtil { public static String stackTraceText(@NotNull Throwable t) { StringBuilderWriter stringWriter = new StringBuilderWriter(); t.printStackTrace(new PrintWriter(stringWriter)); return stringWriter.toString(); } }
ExceptionUtil { public static String stackTraceText(@NotNull Throwable t) { StringBuilderWriter stringWriter = new StringBuilderWriter(); t.printStackTrace(new PrintWriter(stringWriter)); return stringWriter.toString(); }  }
ExceptionUtil { public static String stackTraceText(@NotNull Throwable t) { StringBuilderWriter stringWriter = new StringBuilderWriter(); t.printStackTrace(new PrintWriter(stringWriter)); return stringWriter.toString(); }  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); }
ExceptionUtil { public static String stackTraceText(@NotNull Throwable t) { StringBuilderWriter stringWriter = new StringBuilderWriter(); t.printStackTrace(new PrintWriter(stringWriter)); return stringWriter.toString(); }  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);  }