public static ThreadState getCurrentThreadState() {
    ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
    ThreadInfo thread = threadMXBean.getThreadInfo(Thread.currentThread().getId());
    return new ThreadState(threadMXBean, thread);
  }
Returns a map from thread ID to stats about that thread for every thread that has run, even completed ones.
planetiler-core/src/main/java/com/onthegomap/planetiler/stats/ProcessInfo.java