Element previous = getCurrentElement(element.getKey(), context);
Element elementForWrite = copyElementForWrite(element);
if (previous != null && comparator.equals(previous, elementForWrite)) {
Element oldElement = getQuietFromUnderlyingStore(element.getObjectKey());
context.addCommand(new StoreRemoveCommand(element.getObjectKey(), oldElement), elementForWrite);
return copyElementForRead(previous);
}
return null;
}