@@ -0,0 +1,945 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.%0Apackage com.yahoo.concurrent;%0A%0Aimport java.util.Arrays;%0Aimport java.util.Collection;%0Aimport java.util.List;%0A%0A/**%0A * @author bjorncs%0A */%0Apublic class Threads %7B%0A%0A    private Threads() %7B%7D%0A%0A    /** Returns all threads in JVM */%0A    public static Collection%3CThread%3E getAllThreads() %7B%0A        ThreadGroup root = Thread.currentThread().getThreadGroup();%0A        ThreadGroup parent;%0A        while ((parent = root.getParent()) != null) %7B%0A            root = parent;%0A        %7D%0A        // The number of threads may increase between activeCount() and enumerate()%0A        Thread%5B%5D threads = new Thread%5Broot.activeCount() + 100%5D;%0A        int count;%0A        while ((count = root.enumerate(threads, true)) == threads.length) %7B%0A            threads = new Thread%5Bthreads.length + 1000%5D;%0A        %7D%0A        return List.of(Arrays.copyOf(threads, count));%0A    %7D%0A%7D%0A

Add helper to get all threads in JVM