CharSequence ( @NotNull Map<String, Thread> after, @NotNull Map<Thread, StackTraceElement[]> stackTraces ) { StringBuilder f = new StringBuilder(); after.forEach((name, thread) -> { f.append("\"").append(name).append("\" (").append(thread.isAlive() ? "alive" : "dead").append(") ").append(thread.getState()); f.append("\n"); for (StackTraceElement element : stackTraces.get(thread)) { f.append("\tat ").append(element).append("\n"); } f.append("\n"); }); return f; }