docs: private CmsContainerElementBean getModelReplacementElement(
          CmsContainerElementBean element,
          CmsContainerElementBean baseElement,
          boolean allowCopyModel) {
  
          boolean resetSettings = false;
          if (!baseElement.isCopyModel() && !baseElement.getFormatterId().equals(element.getFormatterId())) {
              I_CmsFormatterBean formatter = m_configData.getCachedFormatters().getFormatters().get(
                  element.getFormatterId());
              resetSettings = (formatter == null)
                  || !formatter.getResourceTypeNames().contains(
                      OpenCms.getResourceManager().getResourceType(baseElement.getResource()).getTypeName());
          }
          Map<String, String> settings;
          if (resetSettings) {
              settings = new HashMap<String, String>();
              for (String id : KEEP_SETTING_IDS) {
                  if (element.getIndividualSettings().containsKey(id)) {
                      settings.put(id, element.getIndividualSettings().get(id));
                  }
              }
              settings.put(CmsContainerElement.MODEL_GROUP_ID, element.getId().toString());
              // transfer all other settings
              for (Entry<String, String> settingEntry : baseElement.getIndividualSettings().entrySet()) {
                  if (!settings.containsKey(settingEntry.getKey())) {
                      settings.put(settingEntry.getKey(), settingEntry.getValue());
                  }
              }
          } else {
              settings = new HashMap<String, String>(element.getIndividualSettings());
              if (!(baseElement.isCopyModel() && allowCopyModel)) {
                  // skip the model id in case of copy models
                  settings.put(CmsContainerElement.MODEL_GROUP_ID, element.getId().toString());
                  if (allowCopyModel) {
                      // transfer all other settings
                      for (Entry<String, String> settingEntry : baseElement.getIndividualSettings().entrySet()) {
                          if (!settings.containsKey(settingEntry.getKey())) {
                              settings.put(settingEntry.getKey(), settingEntry.getValue());
                          }
                      }
                  }
  
              } else if (baseElement.isCopyModel()) {
                  settings.put(CmsContainerElement.MODEL_GROUP_STATE, ModelGroupState.wasModelGroup.name());
              }
          }
          return CmsContainerElementBean.cloneWithSettings(baseElement, settings);
      }