@VisibleForTesting
  Operation<K, V, U> getLatestPutUpdateOrDelete(K key) {
    final Collection<Operation<K, V, U>> operations = batch.getOperations();
    final Iterator<Operation<K, V, U>> iterator = operations.iterator();
    Operation<K, V, U> lastUpdate = null;
    while (iterator.hasNext()) {
      final Operation<K, V, U> operation = iterator.next();
      if ((operation instanceof PutOperation || operation instanceof DeleteOperation ||
          operation instanceof UpdateOperation) && operation.getKey().equals(key)) {
        lastUpdate = operation;
      }
    }
    return lastUpdate;
  }
Get the latest Put/Update/Delete operation for the specified key.
samza-core/src/main/java/org/apache/samza/table/batching/BatchProcessor.java