Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.Set; public class Main { /** * @return the currently-live threads. */ public static Set<Thread> getCurrentThreads() { return Thread.getAllStackTraces().keySet(); } }