private final void add(ThreadGroup g){
synchronized (this) {
    if (destroyed) {
      throw new IllegalThreadStateException();
    }
    if (groups == null) {
      groups=new ThreadGroup[4];
    }
 else     if (ngroups == groups.length) {
      groups=Arrays.copyOf(groups,ngroups * 2);
    }
    groups[ngroups]=g;
    ngroups++;
  }
}

private final void add ( ThreadGroup g ) { synchronized ( this ) { if ( destroyed ) { throw new IllegalThreadStateException ( ) ; } if ( groups == null ) { groups = new ThreadGroup [ 4 ] ; } else if ( ngroups == groups . length ) { groups = Arrays . copyOf ( groups , ngroups * 2 ) ; } groups [ ngroups ] = g ; ngroups ++ ; } }
adds the specified thread group to this group .
