docs: public static void printStackTraces(PrintWriter writer, List<String> currentStacktrace) {
          if (currentStacktrace == null) {
              currentStacktrace = new ArrayList<>();
          }
  
          Map<Thread, StackTraceElement[]> traces = Thread.getAllStackTraces();
          StackTraceElement[] myTrace = traces.get(Thread.currentThread());
          for (StackTraceElement ste : myTrace) {
              currentStacktrace.add(ste.toString());
          }
  
          writer.println();
          writer.println("****** Current Thread ****** ");
          for (String currentStackElem : currentStacktrace) {
              writer.println(currentStackElem);
          }
  
          writer.println("****** All Threads ******");
          Iterator<Thread> it = traces.keySet().iterator();
          while (it.hasNext())
          {
              Thread key = it.next();
              writer.println();
              StackTraceElement[] st = traces.get(key);
              writer.println("****** " + key + " ******");
              for (StackTraceElement ste : st) {
                  writer.println(ste);
              }
          }
      }