@Override
  protected int getNextBufferSize(E[] buffer) {
    long maxSize = maxQueueCapacity / 2;
    if (buffer.length > maxSize) {
      throw new IllegalStateException();
    }
    final int newSize = 2 * (buffer.length - 1);
    return newSize + 1;
  }
@Test(dataProvider = "full")
  public void getNextBufferSize_invalid(MpscGrowableArrayQueue<Integer> queue) {
    var buffer = new Integer[FULL_SIZE + 1];
    assertThrows(IllegalStateException.class, () -> queue.getNextBufferSize(buffer));
  }