@Override
    public synchronized KeyValue<K, V> next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        final KeyValue<K, V> result = next;
        next = null;
        return result;
    }
Optimized {@link KeyValueIterator} used when the same element could be peeked multiple times.
streams/src/main/java/org/apache/kafka/streams/state/internals/DelegatingPeekingKeyValueIterator.java