public static void waitForConcurrentSerialSenderQueueToDrain(String senderId) {
    Set<GatewaySender> senders = cache.getGatewaySenders();
    GatewaySender sender =
        senders.stream().filter(s -> s.getId().equals(senderId)).findFirst().get();

    await().untilAsserted(() -> {
      Set<RegionQueue> queues = ((AbstractGatewaySender) sender).getQueues();
      for (RegionQueue q : queues) {
        assertThat(q.size()).isEqualTo(0);
      }
    });
  }
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