code: public CmsContainerPageBean readModelGroups(CmsContainerPageBean page) {
  
          List<CmsContainerBean> resultContainers = new ArrayList<CmsContainerBean>();
          for (CmsContainerBean container : page.getContainers().values()) {
              boolean hasModels = false;
              List<CmsContainerElementBean> elements = new ArrayList<CmsContainerElementBean>();
              for (CmsContainerElementBean element : container.getElements()) {
                  try {
                      element.initResource(m_cms);
                      if (isModelGroupResource(element.getResource())) {
                          hasModels = true;
                          CmsContainerPageBean modelGroupPage = getContainerPageBean(element.getResource());
                          CmsContainerElementBean baseElement = getModelBaseElement(
                              modelGroupPage,
                              element.getResource());
                          if (baseElement == null) {
                              LOG.error(
                                  "Error rendering model group '"
                                      + element.getResource().getRootPath()
                                      + "', base element could not be determind.");
                              continue;
                          }
                          String baseInstanceId = baseElement.getInstanceId();
                          CmsContainerElementBean replaceElement = getModelReplacementElement(
                              element,
                              baseElement,
                              false);
                          if (m_sessionCache != null) {
                              m_sessionCache.setCacheContainerElement(replaceElement.editorHash(), replaceElement);
                          }
                          elements.add(replaceElement);
                          resultContainers.addAll(
                              readModelContainers(
                                  baseInstanceId,
                                  element.getInstanceId(),
                                  modelGroupPage,
                                  baseElement.isCopyModel()));
                      } else {
                          elements.add(element);
                      }
                  } catch (CmsException e) {
                      LOG.info(e.getLocalizedMessage(), e);
                  }
              }
              if (hasModels) {
                  resultContainers.add(
                      new CmsContainerBean(
                          container.getName(),
                          container.getType(),
                          container.getParentInstanceId(),
                          container.isRootContainer(),
                          container.getMaxElements(),
                          elements));
              } else {
                  resultContainers.add(container);
              }
          }
          return new CmsContainerPageBean(resultContainers);
      }
docs: Reads the present model groups and merges their containers into the page.<p>
  
  @param page the container page
  
  @return the resulting container page