public void forEach(Consumer<T> consumer) {
        synchronized (operations) {
            List<Operation<T>> removedList = new ArrayList<>();
            for (int i = 0; i < snapshotIndex; i++) {
                Operation<T> operation = operations.get(i);
                if (operation.tombstoneMatcher != null) {
                    removedList.add(operation);
                }
            }
            for (int i = 0; i < snapshotIndex; i++) {
                Operation<T> operation = operations.get(i);
                if (operation.tombstoneMatcher == null) {
                    if (!isRemoved(operation, removedList)) {
                        consumer.accept(operation.t);
                    }
                }
            }
        }
    }
Reverse iterate the list

@param func accept a list element, return break loop mark.
metadata/src/main/java/org/apache/kafka/image/DeltaList.java