code: public void deleteGroup(CmsRequestContext context, CmsUUID groupId, CmsUUID replacementId)
      throws CmsException, CmsRoleViolationException, CmsSecurityException {
  
          CmsGroup group = readGroup(context, groupId);
          if (group.isRole()) {
              throw new CmsSecurityException(Messages.get().container(Messages.ERR_DELETE_ROLE_GROUP_1, group.getName()));
          }
          CmsDbContext dbc = null;
          try {
              dbc = getDbContextForDeletePrincipal(context);
              // catch own exception as special cause for general "Error deleting group".
              checkRole(dbc, CmsRole.ACCOUNT_MANAGER.forOrgUnit(getParentOrganizationalUnit(group.getName())));
              m_driverManager.deleteGroup(dbc, group, replacementId);
          } catch (Exception e) {
              CmsDbContext dbcForException = m_dbContextFactory.getDbContext(context);
              dbcForException.report(null, Messages.get().container(Messages.ERR_DELETE_GROUP_1, group.getName()), e);
              dbcForException.clear();
          } finally {
              if (null != dbc) {
                  dbc.clear();
              }
          }
      }
docs: Deletes a group, where all permissions, users and children of the group
  are transfered to a replacement group.<p>
  
  @param context the current request context
  @param groupId the id of the group to be deleted
  @param replacementId the id of the group to be transfered, can be <code>null</code>
  
  @throws CmsException if operation was not successful
  @throws CmsSecurityException if the group is a default group.
  @throws CmsRoleViolationException if the current user does not own the rule {@link CmsRole#ACCOUNT_MANAGER}