final List operationsToRemove = new ArrayList();
// not using an iterator on purpose since the ehcache express types don't support it
for (int i = 0; i < operations.size(); i++) {
Object operation = operations.get(i);
KeyBasedOperation keyBasedOperation = converter.convert(operation);
if (!mostRecent.containsKey(keyBasedOperation.getKey())) {
mostRecent.put(keyBasedOperation.getKey(), operation);
} else {
Object previousOperation = mostRecent.get(keyBasedOperation.getKey());
KeyBasedOperation keyBasedPreviousOperation = converter.convert(previousOperation);
if (keyBasedPreviousOperation.getCreationTime() > keyBasedOperation.getCreationTime()) {
operationsToRemove.add(operation);
} else {
operationsToRemove.add(previousOperation);
mostRecent.put(keyBasedOperation.getKey(), operation);
}