### Question:
ExceptionUtils { public static String getExceptionStackMsg(Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); return sw.toString(); }  static String getExceptionStackMsg(Exception e);  }### Answer:
@Test public void getExceptionStackMsgUsage() { String text = null; int a = 10; int b = 0; try { if (a % b == 0) { text = "sxp"; } if (text.equals("sxp")) { System.out.println("equals"); } } catch (Exception e) { System.out.print("ExceptionStackMsg:"); System.out.println(ExceptionUtils.getExceptionStackMsg(e)); } }