if(!isSet()) { getListChanges().clear(); }
  public void applyAndReverse(EObject originalObject)  {    EStructuralFeature feature = getFeature();    if (feature != null)    {      if (!isSet())      {        if (feature.isMany())        {          ListChange listChange = ChangeFactory.eINSTANCE.createListChange();          listChange.setKind(ChangeKind.ADD_LITERAL);          listChange.setIndex(0);          getListChanges().add(listChange);          listChange.getValues().addAll((EList)originalObject.eGet(feature));        }        originalObject.eUnset(feature);      }      else if (feature.isMany())      {        if (listChanges != null)        {          if (feature instanceof EReference && (((EReference)feature).getEOpposite() != null || ((EReference)feature).isContainment()))          {            // Bi-directional references need to use this less efficient approach because some            //  or all of the changes may already have been made from the other end.            //            EcoreUtil.setEList((EList)originalObject.eGet(feature), (EList)getValue());          }          else          {            EList applyToList = (EList)originalObject.eGet(feature);            for (Iterator iter = getListChanges().iterator(); iter.hasNext(); )            {              ListChange listChange = (ListChange)iter.next();              listChange.applyAndReverse(applyToList);            }          }          ECollections.reverse(getListChanges());        }      }      else      {        originalObject.eSet(feature, getValue());      }      setSet(newIsSet);      setValue(newValue);    }  }