public static void waitForAsyncQueueToGetEmpty(String asyncQueueId) {
    AsyncEventQueue theAsyncEventQueue = null;

    Set<AsyncEventQueue> asyncEventChannels = cache.getAsyncEventQueues();
    for (AsyncEventQueue asyncChannel : asyncEventChannels) {
      if (asyncQueueId.equals(asyncChannel.getId())) {
        theAsyncEventQueue = asyncChannel;
      }
    }

    assertThat(theAsyncEventQueue).isNotNull();

    final GatewaySender sender = ((AsyncEventQueueImpl) theAsyncEventQueue).getSender();

    if (sender.isParallel()) {
      final Set<RegionQueue> queues = ((AbstractGatewaySender) sender).getQueues();
      await().untilAsserted(() -> {
        int size = 0;
        for (RegionQueue q : queues) {
          size += q.size();
        }
        assertThat(size).as("Expected queue size to be : " + 0 + " but actual entries: " + size)
            .isEqualTo(0);
      });
    } else {
      await().untilAsserted(() -> {
        Set<RegionQueue> queues = ((AbstractGatewaySender) sender).getQueues();
        int size = 0;
        for (RegionQueue q : queues) {
          size += q.size();
        }
        assertThat(size).as("Expected queue size to be : " + 0 + " but actual entries: " + size)
            .isEqualTo(0);
      });
    }
  }
To be used only for ParallelGatewaySender.

@param senderId Id of the ParallelGatewaySender
geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java