code: static public Thread getThread(final long id) {
          final Thread[] threads = getAllThreads();
          for (Thread thread : threads)
              if (thread.getId() == id)
                  return thread;
          return null;
      }
docs: Gets a thread by its assigned ID.  Internally, this method calls
  getAllThreads() so be careful to only call this method once and cache
  your result.
  @param id The thread ID
  @return The thread with this ID or null if none were found