+ public static void debugAllThreads() {
+ // Search remaining threads that are not main nor daemon
+ for (Thread t : Thread.getAllStackTraces().keySet())
+ if (! t.isDaemon() && !t.getName().equals("main"))
+ System.err.println("Thread "+t.getName()+" is still running! Please report that bug");
+ }