}
// Check for existing versions - remember which items to
// remove in case of success
List<Versioned<V>> itemsToRemove = new ArrayList<Versioned<V>>(items.size());
for(Versioned<V> versioned: items) {
Occurred occurred = value.getVersion().compare(versioned.getVersion());
if(occurred == Occurred.BEFORE) {
throw new ObsoleteVersionException("Obsolete version for key '" + key + "': "
+ value.getVersion());
} else if(occurred == Occurred.AFTER) {
itemsToRemove.add(versioned);