### Question:
ThreadUtils { public static String lastStacktrace() { return lastStacktrace(Thread.currentThread().getStackTrace()); } private  ThreadUtils(); static void sleep(long millis); static void sleep(long time, TimeUnit timeUnit); static String last3Stacktrace(); static String last5Stacktrace(); static String lastStacktrace(); static String lastStacktrace(StackTraceElement[] stackTraceElements); static String lastStacktrace(StackTraceElement[] stackTraceElements, int elementNumber); static String getStacktraceSpec(StackTraceElement element); static String getStackTrace(Throwable exception); static String getStackTraceSilently(Throwable exception);  }### Answer:
@Test void lastStacktrace() { StackTraceElement[] stack = Thread.currentThread().getStackTrace(); int length = stack.length; String result0 = ThreadUtils.lastStacktrace(); assertNotNull(result0); String result = ThreadUtils.lastStacktrace(stack, length); assertNotNull(result); assertTrue(result.length() < result0.length()); String result2 = ThreadUtils.lastStacktrace(stack, length + 10); assertNotNull(result2); assertEquals(result, result2); String result3 = ThreadUtils.lastStacktrace(stack, length - 2); assertNotNull(result3); assertTrue(result3.length() < result.length()); }