code: private void addChild(Session session, GroupImpl parent, GroupImpl child, boolean broadcast) throws Exception
     {
        Node parentNode = utils.getGroupNode(session, parent);
        Node groupNode =
           parentNode.addNode(child.getGroupName(), JCROrganizationServiceImpl.JOS_HIERARCHY_GROUP_NODETYPE);
  
        String parentId = parent == null ? null : parent.getId();
  
        child.setParentId(parentId);
        child.setInternalId(groupNode.getUUID());
  
        if (broadcast)
        {
           preSave(child, true);
        }
  
        writeGroup(child, groupNode);
        session.save();
  
        putInCache(child);
  
        if (broadcast)
        {
           postSave(child, true);
        }
     }
docs: Adds child group.