@Override
  @SuppressWarnings({"CastCanBeRemovedNarrowingVariableType", "unchecked"})
  public E peek() {
    final E[] buffer = consumerBuffer;
    final long index = consumerIndex;
    final long mask = consumerMask;

    final long offset = modifiedCalcElementOffset(index, mask);
    Object e = lvElement(buffer, offset);// LoadLoad
    if (e == null && index != lvProducerIndex(this)) {
      // peek() == null iff queue is empty, null element is not strong enough indicator, so we must
      // check the producer index. If the queue is indeed not empty we spin until element is
      // visible.
      while ((e = lvElement(buffer, offset)) == null) {
        // retry
      }
    }
    if (e == JUMP) {
      return newBufferPeek(getNextBuffer(buffer, mask), index);
    }
    return (E) e;
  }
@Test(dataProvider = "populated")
  public void peek_whenPopulated(MpscGrowableArrayQueue<Integer> queue) {
    assertThat(queue.peek()).isNotNull();
    assertThat(queue).hasSize(POPULATED_SIZE);
  }