private List<ModelExtensionDefinitionHeader> getHeaderList(
     List<ModelExtensionDefinition> medList) {
   CoreArgCheck.isNotNull(medList, "medList is null"); // $NON-NLS-1$
   List<ModelExtensionDefinitionHeader> headerList = new ArrayList(medList.size());
   for (ModelExtensionDefinition med : medList) {
     headerList.add(med.getHeader());
   }
   return headerList;
 }
  public void updateModelExtensionDefinition(ModelExtensionDefinition med) {
    CoreArgCheck.isNotNull(med, "med is null"); // $NON-NLS-1$

    // if the current MED header list does not contain a match already, then add this med
    ModelExtensionDefinitionHeader updateMedHeader = med.getHeader();

    // replace current header with this new one
    for (ModelExtensionDefinitionHeader header : this.currentMedHeaderList) {
      if (header.getNamespacePrefix().equals(updateMedHeader.getNamespacePrefix())) {
        this.currentMedHeaderList.remove(header);
        this.currentMedHeaderList.add(updateMedHeader);
        break;
      }
    }

    this.namespacesToUpdateList.add(updateMedHeader.getNamespacePrefix());
  }
  public void addModelExtensionDefinition(ModelExtensionDefinition med) {
    CoreArgCheck.isNotNull(med, "med is null"); // $NON-NLS-1$

    // if the current MED header list does not contain a match already, then add this med
    ModelExtensionDefinitionHeader medHeader = med.getHeader();
    if (!this.currentMedHeaderList.contains(medHeader)) {
      this.currentMedHeaderList.add(medHeader);

      // Include in the 'add' list - If the original Med list does not contain this
      if (!this.originalMedHeaderList.contains(medHeader)) {
        this.medsToAddList.add(med);
      }
    }

    // If the added meds prefix was on the remove list, take it off
    String nsPrefix = med.getNamespacePrefix();
    this.namespacesToRemoveList.remove(nsPrefix);
  }