public final boolean parentOf(ThreadGroup g){
  for (; g != null; g=g.parent) {
    if (g == this) {
      return true;
    }
  }
  return false;
}

public final boolean parentOf ( ThreadGroup g ) { for ( ; g != null ; g = g . parent ) { if ( g == this ) { return true ; } } return false ; }
tests if this thread group is either the thread group argument or one of its ancestor thread groups .
