InvocationCallback queuePoll() {
      InvocationCallback element;
      synchronized (this) {
         if (tail != head) {
            element = elements[head & mask];
            head++;
         } else {
            element = null;
            frozen = true;
         }
      }
      return element;
   }
@Test(dataProvider = "offsets")
   public void testExpandCapacity(int splitOffset) throws Throwable {
      CompletableFuture<Object> future = new CompletableFuture<>();
      QueueAsyncInvocationStage stage =
            new QueueAsyncInvocationStage(null, null, future, makeCallback(0));
      assertCallback(0, stage.queuePoll());
      addAndPoll(stage, splitOffset);

      // Now trigger 2 expansions
      int count = 2 * QueueAsyncInvocationStage.QUEUE_INITIAL_CAPACITY;
      addAndPoll(stage, count);
   }