@Override
    public E peek() {
        // local load of field to avoid repeated loads after volatile reads
        final long[] sBuffer = sequenceBuffer;
        final long mask = this.mask;
        long cIndex;
        long seq;
        long seqOffset;
        long expectedSeq;
        // start with bogus value, hope we don't need it
        long pIndex = -1;
        E e;
        while (true) {
            cIndex = lvConsumerIndex();
            seqOffset = calcCircularLongElementOffset(cIndex, mask);
            seq = lvLongElement(sBuffer, seqOffset);
            expectedSeq = cIndex + 1;
            if (seq < expectedSeq) {
                // slot has not been moved by producer
                if (// test against cached pIndex
                cIndex >= pIndex && // update pIndex if we must
                cIndex == (pIndex = lvProducerIndex())) {
                    // strict empty check, this ensures [Queue.poll() == null iff isEmpty()]
                    return null;
                }
            } else if (seq == expectedSeq) {
                final long offset = calcCircularRefElementOffset(cIndex, mask);
                e = lvRefElement(buffer, offset);
                if (lvConsumerIndex() == cIndex)
                    return e;
            }
        }
    }
{@inheritDoc}
<p>
Because return null indicates queue is empty we cannot simply rely on next element visibility for poll
and must test producer index when next element is not visible.
jctools-core/src/main/java/org/jctools/queues/unpadded/MpmcUnpaddedArrayQueue.java