code: private int getThreadState( Thread.State state ) {
  		
  		Thread[] threads = getAllThreads();
  		int ct = 0;
  		
  		for( Thread thread : threads ) {
  			if (state.equals(thread.getState()) )
  				ct++;
  		}
  		
  		return ct;
  		
  	}
docs: Utility method to retrieve the number of threads of
  a specified state.
  @param state Target Thread.State to retrieve.
  @return Total threads in specified state.