@Override
    public E peek()
    {
        final long consumerPosition = lvConsumerPosition();
        final int offset = calcElementOffset(consumerPosition, this.mask);
        E e = this.buffer.get(offset);
        if (e != null)
        {
            return e;
        }
        final int activeCycleIndex = activeCycleIndex(lvActiveCycleId());
        final long producerCycleClaim = AtomicLongArrayAccess.lvValue(this.producerCycleClaim, activeCycleIndex);
        final long producerPosition = producerPosition(
            cycleId(producerCycleClaim, this.cycleIdBitShift),
            positionOnCycle(producerCycleClaim, this.positionOnCycleMask),
            this.cycleLengthLog2);
        if (producerPosition == consumerPosition)
        {
            return null;
        }
        else
        {
            while ((e = buffer.get(offset)) == null)
            {

            }
            return e;
        }
    }
NOTE: This class was automatically generated by org.jctools.queues.atomic.JavaParsingAtomicArrayQueueGenerator
which can found in the jctools-build module. The original source file is MpscArrayQueue.java.
jctools-experimental/src/main/java/org/jctools/queues/atomic/MpscRelaxedAtomicArrayQueue.java