public boolean hasNext() {
                return !queue.isEmpty() || endPosition - position.value >= AbortedTxn.TOTAL_SIZE;
            }
Note that nextOffset in stream here actually represents the physical size (or position).
core/src/main/scala/kafka/log/streamaspect/ElasticTransactionIndex.java