Group g = GroupFinder.findByName(
GroupFinder.findByName(
  public Group addChildGroup(String extension, String displayExtension)     throws  GroupAddException,            InsufficientPrivilegeException  {    StopWatch sw = new StopWatch();    sw.start();    try {      AttributeValidator.namingValue(extension);      AttributeValidator.namingValue(displayExtension);    }    catch (ModelException eM) {      throw new GroupAddException(eM.getMessage(), eM);    }    PrivilegeResolver.getInstance().canCREATE(      this.getSession(), this, this.getSession().getSubject()    );    if (this.equals(StemFinder.findRootStem(this.getSession()))) {      throw new GroupAddException(        "cannot create groups at root stem level"      );    }     try {      Group g = GroupFinder.findByName(        constructName(this.getName(), extension)      );      throw new GroupAddException("group already exists");    }    catch (GroupNotFoundException eGNF) {      // Ignore.  This is what we want.    }    try {      _initializeChildGroupsAndStems(this);    }    catch (HibernateException eH) {      throw new GroupAddException(eH.getMessage(), eH);    }    try {      Group child = new Group(this.getSession(), this, extension, displayExtension);      // Set parent      child.setParent_stem(this);      // Add to children       Set children  = this.getChild_groups();      children.add(child);      this.setChild_groups(children);      // Now create as member      Member  m   = new Member( new GrouperSubject(child) );      // And save      Set objects = new LinkedHashSet();      objects.add(child);      objects.add(this);      objects.add(m);      HibernateHelper.save(objects);      sw.stop();      EL.stemAddChildGroup(this.getSession(), child.getName(), sw);      _grantDefaultPrivsUponCreate(child);      return child; // And return the newly created group    }    catch (Exception e) {      throw new GroupAddException(        "Unable to add group " + this.getName() + ":" + extension + ": "         + e.getMessage(), e      );    }  } // public Group addChildGroup(extension, displayExtension)