@Internal
  public static ThreadInfo @NotNull [] sort(@NotNull ThreadInfo @NotNull [] threads) {
    Arrays.sort(threads, Comparator
      .comparing((ThreadInfo threadInfo) -> !isEDT(threadInfo.getThreadName())) // show EDT first
      .thenComparing(threadInfo -> threadInfo.getThreadState() != Thread.State.RUNNABLE) // then all runnable
      .thenComparingInt(threadInfo -> {
        StackTraceElement[] trace = threadInfo.getStackTrace();
        return trace == null ? 0 : -trace.length;
      }) // show meaningful stacktraces first
      .thenComparing(threadInfo -> StringUtilRt.notNullize(threadInfo.getThreadName())) // sorted by name among same stacktraces
    );
    return threads;
  }
@Internal
  public static ThreadInfo @NotNull [] sort(@NotNull ThreadInfo @NotNull [] threads)