public static void verifyQueueSize(String senderId, int size) {
    GatewaySender sender = getGatewaySender(senderId);

    if (!sender.isParallel()) {
      final Set<RegionQueue> queues = ((AbstractGatewaySender) sender).getQueues();
      int queueSize = 0;
      for (RegionQueue q : queues) {
        queueSize += q.size();
      }

      assertThat(queueSize).as("verifyQueueSize failed for sender " + senderId).isEqualTo(size);
    } else if (sender.isParallel()) {
      RegionQueue regionQueue =
          ((AbstractGatewaySender) sender).getQueues().toArray(new RegionQueue[1])[0];
      assertThat(regionQueue.size()).as("verifyQueueSize failed for sender " + senderId)
          .isEqualTo(size);
    }
  }
Checks that the bucketToTempQueueMap for a partitioned region
that holds events for buckets that are not available locally, is empty.
geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java