Here you can find the source of dumpThreads()
public static void dumpThreads()
//package com.java2s; //License from project: Apache License public class Main { public static void dumpThreads() { ThreadGroup group = Thread.currentThread().getThreadGroup(); int activeCount = group.activeCount(); Thread[] threads = new Thread[activeCount]; group.enumerate(threads);//from www . j ava 2s . c o m System.out.println("Thread-Group " + group + " contains " + activeCount + " threads"); for (Thread thread : threads) { System.out.println("Thread " + thread); } } }