Actually it is still possible: consider the case where (digits are ts)    fifoQueue = {2}  headRecord = 1    Now when we called `queue.poll` we return the record with ts 1, and updated the headRecord to 2:    fifoQueue = {}  headRecord = 2    I.e. the `headRecord` always stores the record to-be-returned in the next call. And the partition ts is corresponding to its ts. Does that make sense?