### Question:
ExceptionUtils { public static String getString(Throwable throwable) { if (throwable == null) { return null; } StringWriter stringWriter = new StringWriter(); throwable.printStackTrace(new PrintWriter(stringWriter)); return stringWriter.toString(); }  static String getString(Throwable throwable);  }### Answer:
@Test public void testStackTrace() { RuntimeException oops = new RuntimeException("oops"); String result = ExceptionUtils.getString(oops); assertTrue(result.startsWith("java.lang.RuntimeException: oops")); }