ExceptionUtils { public static String trace() { final Thread th = Thread.currentThread(); final StackTraceElement[] elements = th.getStackTrace(); return trace(elements, 2, elements.length); }  static String buildExceptionMessage(
      final String message,
      final Throwable cause); static String trace(); static String trace(
      final StackTraceElement[] elements); static String trace(
      final StackTraceElement[] elements,
      final int start,
      final int end); static String getStackTraceOf(
      final Throwable e); static StackTraceElement[] concat(final StackTraceElement[] left,
      final StackTraceElement[] right);  }
@Test public void testTrace() { assertNotNull(ExceptionUtils.trace()); }
@Test public void testTraceOnStackTraceElement() { final Thread th = Thread.currentThread(); final StackTraceElement[] elements = th.getStackTrace(); assertNull(ExceptionUtils.trace(null)); assertNotNull(ExceptionUtils.trace(elements)); }
@Test public void testTraceOnStackTraceElementWithStartAndEnd() { final Thread th = Thread.currentThread(); final StackTraceElement[] elements = th.getStackTrace(); final int start = 0; final int end = elements.length; assertNull(ExceptionUtils.trace(null, start, end)); try { ExceptionUtils.trace(elements, start - 1, end); } catch (Exception e) { assertSame(ArrayIndexOutOfBoundsException.class, e.getClass()); } try { ExceptionUtils.trace(elements, start, end + 1); } catch (Exception e) { assertSame(ArrayIndexOutOfBoundsException.class, e.getClass()); } try { ExceptionUtils.trace(elements, start - 1, end + 1); } catch (Exception e) { assertSame(ArrayIndexOutOfBoundsException.class, e.getClass()); } assertNotNull(ExceptionUtils.trace(elements, start, end)); }