/**
   * INTERNAL: Build and return the change record that results from comparing the two collection
   * attributes.
   */
  public ChangeRecord compareForChange(
      Object clone, Object backup, ObjectChangeSet owner, AbstractSession session) {
    ContainerPolicy cp = this.getContainerPolicy();
    Object cloneCollection = this.getRealCollectionAttributeValueFromObject(clone, session);

    Object backupCollection = null;
    if (owner.isNew()) {
      backupCollection = cp.containerInstance(1);
    } else {
      backupCollection = this.getRealCollectionAttributeValueFromObject(backup, session);
    }

    if (cp.hasOrder()) {
      return this.compareAttributeValuesForChangeWithOrder(
          cloneCollection, backupCollection, owner, session);
    } else {
      return this.compareAttributeValuesForChangeWithoutOrder(
          cloneCollection, backupCollection, owner, session);
    }
  }