code: public final boolean parentOf(ThreadGroup g) {
          for (; g != null ; g = g.parent) {
              if (g == this) {
                  return true;
              }
          }
          return false;
      }
docs: Tests if this thread group is either the thread group
  argument or one of its ancestor thread groups.
  
  @param   g   a thread group.
  @return  <code>true</code> if this thread group is the thread group
  argument or one of its ancestor thread groups;
  <code>false</code> otherwise.
  @since   JDK1.0