### Question:
ExceptionUtils { public static String toString(Throwable error) { if (error == null) return null; StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter); error.printStackTrace(printWriter); return stringWriter.toString(); }  static String toString(Throwable error);  }### Answer:
@Test public void toString_should_return_null__when_null_is_provided() { assertThat(ExceptionUtils.toString(null)).isNull(); }
@Test public void toString_should_return_the_stacktrace() { Exception ex = new Exception("Erf"); String str = ExceptionUtils.toString(ex); assertThat(str).startsWith("" + "java.lang.Exception: Erf\n" + "\tat tzatziki.util.ExceptionUtilsTest.toString_should_return_the_stacktrace(ExceptionUtilsTest.java:"); }