ExceptionUtils { public static String getFullStackTrace(Throwable throwable) { StackTraceElement[] stackElements = throwable.getStackTrace(); StringBuilder sb = new StringBuilder("["); if (stackElements != null) { for (int i = 0; i < stackElements.length; i++) { sb.append("["); sb.append("\"" + stackElements[i].getClassName()).append("\","); sb.append("\"" + stackElements[i].getFileName()).append("\","); sb.append("\"" + stackElements[i].getLineNumber()).append("\","); sb.append("\"" + stackElements[i].getMethodName()).append("\"],"); } } String str = CharMatcher.anyOf(",").trimTrailingFrom(sb.toString()); return str + "]"; }  static String getFullStackTrace(Throwable throwable);  }
@Test public void testGetFullStackTrace() throws Exception { String msg = ExceptionUtils.getFullStackTrace(new RuntimeException("testGetFullStackTrace")); List<List> list=JsonUtils.jsonToList(msg,List.class); List e=list.get(0); Assert.assertEquals("testGetFullStackTrace",e.get(3)); }