docs: public CmsContainerPageBean saveModelGroups(CmsContainerPageBean page, CmsResource pageResource)
      throws CmsException {
  
          CmsUUID modelElementId = null;
          CmsContainerElementBean baseElement = null;
          for (CmsContainerElementBean element : page.getElements()) {
              if (element.isModelGroup()) {
                  modelElementId = element.getId();
                  baseElement = element;
                  break;
  
              }
          }
          List<CmsContainerBean> containers = new ArrayList<CmsContainerBean>();
          for (CmsContainerBean container : page.getContainers().values()) {
              List<CmsContainerElementBean> elements = new ArrayList<CmsContainerElementBean>();
              boolean hasChanges = false;
              for (CmsContainerElementBean element : container.getElements()) {
                  if (element.isModelGroup() && !element.getId().equals(modelElementId)) {
                      // there should not be another model group element, remove the model group settings
                      Map<String, String> settings = new HashMap<String, String>(element.getIndividualSettings());
                      settings.remove(CmsContainerElement.MODEL_GROUP_ID);
                      settings.remove(CmsContainerElement.MODEL_GROUP_STATE);
                      elements.add(
                          new CmsContainerElementBean(element.getId(), element.getFormatterId(), settings, false));
                      hasChanges = true;
                  } else {
                      elements.add(element);
                  }
              }
              if (hasChanges) {
                  containers.add(
                      new CmsContainerBean(
                          container.getName(),
                          container.getType(),
                          container.getParentInstanceId(),
                          container.isRootContainer(),
                          container.getMaxElements(),
                          elements));
              } else {
                  containers.add(container);
              }
  
          }
  
          List<CmsProperty> changedProps = new ArrayList<CmsProperty>();
          if (baseElement != null) {
              String val = Boolean.parseBoolean(
                  baseElement.getIndividualSettings().get(CmsContainerElement.USE_AS_COPY_MODEL))
                  ? CmsContainerElement.USE_AS_COPY_MODEL
                  : "";
              changedProps.add(new CmsProperty(CmsPropertyDefinition.PROPERTY_TEMPLATE_ELEMENTS, val, val));
          }
          m_cms.writePropertyObjects(pageResource, changedProps);
  
          return new CmsContainerPageBean(containers);
  
      }