code: private Thread[] getAllThreads() {
  		
  	    final ThreadGroup root = getRootThreadGroup( );
  	    int ct = Thread.activeCount();
  	    int n = 0;
  	    Thread[] threads;
  	    do {
  	        ct *= 2;
  	        threads = new Thread[ ct ];
  	        n = root.enumerate( threads, true );
  	    } while ( n == ct );
  	    return java.util.Arrays.copyOf( threads, n );
  		
  	}
docs: Utility method to return all threads in system owned by the
  root ThreadGroup.
  @return Array of all threads.