FastStackCollector implements ISampler { @Deprecated public static Thread[] getThreads() { return Threads.getThreads(); } FastStackCollector(final boolean collectForMain, final String... xtraIgnoredThreads);  FastStackCollector(final boolean collectRunnableThreadsOnly,
                            final boolean collectForMain,
                            final String... xtraIgnoredThreads);  FastStackCollector(final boolean collectRunnableThreadsOnly,
                            final boolean collectForMain,
                            final Thread[] ignored,
                            final String... xtraIgnoredThreads);  FastStackCollector(final Predicate<Thread> threadFilter, final int maxNrSampledThreads); static Predicate<Thread> createNameBasedFilter(final boolean collectRunnableThreadsOnly,
                                                        final boolean collectForMain,
                                                        final Thread[] ignored,
                                                        final String[] xtraIgnoredThreads); @Deprecated static Thread[] getThreads(); @Deprecated static StackTraceElement[][] getStackTraces(final Thread... threads); @Deprecated static void dumpToPrintStream(final PrintStream stream); @Override @SuppressFBWarnings("EXS_EXCEPTION_SOFTENING_NO_CHECKED") void sample(); @Override Map<String, SampleNode> getCollectionsAndReset(); @Override Map<String, SampleNode> getCollections(); @Override String toString();  }
@Test @SuppressFBWarnings("CLI_CONSTANT_LIST_INDEX") public void testRandomSample() { Thread[] threads = Threads.getThreads(); Threads.randomFirst(2, threads); Assert.assertNull(threads[2]); Assert.assertNotNull(threads[1]); Assert.assertNotSame(threads[0], threads[1]); }