### Question:
ExceptionUtil { public static String transform(final Throwable cause) { if (null == cause) { return ""; } StringWriter result = new StringWriter(); try (PrintWriter writer = new PrintWriter(result)) { cause.printStackTrace(writer); } return result.toString(); }  static String transform(final Throwable cause);  }### Answer:
@Test public void assertTransformWithError() { Assert.assertTrue(ExceptionUtil.transform(new Error("Error")).startsWith("java.lang.Error")); }
@Test public void assertTransformWithException() { Assert.assertTrue(ExceptionUtil.transform(new Exception("Exception")).startsWith("java.lang.Exception")); }
@Test public void assertTransformWithNull() { Assert.assertThat(ExceptionUtil.transform(null), Is.is("")); }