// TODO: This is a little silly. We should do this a better way.
for (int i = 0; i < this.update.changeSize(); ++i) {
String key = this.update.getChangeKey(i);
String newOldValue = updated.containsKey(key) ? updated.get(key)
: this.update.getOldValue(i);
newUpdate = newUpdate.composeWith(new AttributesUpdateImpl(key,
newOldValue, this.update.getNewValue(i)));
}
targetDocument.updateAttributes(newUpdate);
Set<String> keySet = new HashSet<String>();
for (int i = 0; i < this.update.changeSize(); ++i) {