docs: static long getThreadStateCount(ThreadMXBean threadBean, Thread.State state) {
          return Arrays.stream(threadBean.getThreadInfo(threadBean.getAllThreadIds()))
                  .filter(threadInfo -> threadInfo != null && threadInfo.getThreadState() == state)
                  .count();
      }