StacktraceUtils { public static String currentStacktrace() { return Stream.of(new Throwable().getStackTrace()).skip(1).map(StackTraceElement::toString).collect(Collectors.joining("\n at ")); } private  StacktraceUtils(); static String currentStacktrace();  }
@Test public void returnsCurrentStacktrace() { final String stacktrace = currentStacktrace(); assertThat(stacktrace).startsWith(this.getClass().getCanonicalName()).contains("\n at "); }