public void referenceRemoved() {
    setFlag(true, IS_DELETED_MASK);
    if (getOwner() != null) {
      getOwner().removeChild(this);
    }

    for (RefElement refCallee : getOutReferences()) {
      ((RefElementImpl)refCallee).removeInReference(this);
    }

    for (RefElement refCaller : getInReferences()) {
      ((RefElementImpl)refCaller).removeOutReference(this);
    }
  }
public void referenceRemoved()