public static void waitForAsyncQueueToGetEmpty(String asyncQueueId) {
    AsyncEventQueue theAsyncEventQueue = cache.getAsyncEventQueue(asyncQueueId);
    final GatewaySender sender = ((AsyncEventQueueImpl) theAsyncEventQueue).getSender();

    if (sender.isParallel()) {
      final Set<RegionQueue> queues = ((AbstractGatewaySender) sender).getQueues();

      WaitCriterion wc = new WaitCriterion() {
        @Override
        public boolean done() {
          int size = 0;
          for (RegionQueue q : queues) {
            size += q.size();
          }
          return size == 0;
        }

        @Override
        public String description() {
          int size = 0;
          for (RegionQueue q : queues) {
            size += q.size();
          }
          return "Expected queue size to be : " + 0 + " but actual entries: " + size;
        }
      };
      GeodeAwaitility.await().untilAsserted(wc);

    } else {
      WaitCriterion wc = new WaitCriterion() {
        @Override
        public boolean done() {
          Set<RegionQueue> queues = ((AbstractGatewaySender) sender).getQueues();
          int size = 0;
          for (RegionQueue q : queues) {
            size += q.size();
          }
          return size == 0;
        }

        @Override
        public String description() {
          Set<RegionQueue> queues = ((AbstractGatewaySender) sender).getQueues();
          int size = 0;
          for (RegionQueue q : queues) {
            size += q.size();
          }
          return "Expected queue size to be : " + 0 + " but actual entries: " + size;
        }
      };
      GeodeAwaitility.await().untilAsserted(wc);
    }
  }
Validate whether all the attributes set on AsyncEventQueueFactory are set on the sender
underneath the AsyncEventQueue.
geode-dunit/src/main/java/org/apache/geode/internal/cache/wan/AsyncEventQueueTestBase.java