code: public @CheckForNull JvmThread forThread(@CheckForNull Thread needle) {
          if (needle == null) return null;
  
          for (JvmThread candidate: this) {
              final JvmThread jvmThread = candidate;
              if (needle.equals(jvmThread.getThread())) return jvmThread;
          }
          return null;
      }
docs: Get {@link ProcessThread} for given {@link Thread}.