@Test
  public void testPersistentPartitionedRegionWithGatewaySenderStartStopEventsDispatchedNoChangesInQueue()
      throws InterruptedException {
    Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
    Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));

    createCacheInVMs(nyPort, vm2, vm3);

    createCacheInVMs(lnPort, vm4, vm5);
    vm4.invoke(() -> setNumDispatcherThreadsForTheRun(5));
    vm5.invoke(() -> setNumDispatcherThreadsForTheRun(5));

    vm4.invoke(() -> WANTestBase.createSender("ln", 2, true, 100, 10, false, true, null, false));
    vm5.invoke(() -> WANTestBase.createSender("ln", 2, true, 100, 10, false, true, null, false));

    vm4.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), "ln", 1,
        100, isOffHeap()));
    vm5.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), "ln", 1,
        100, isOffHeap()));


    vm2.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), null, 1,
        100, isOffHeap()));
    vm3.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), null, 1,
        100, isOffHeap()));

    vm4.invoke(() -> WANTestBase.doPuts(getTestMethodName(), 1000));


    vm4.invoke(() -> WANTestBase.stopSender("ln"));
    vm5.invoke(() -> WANTestBase.stopSender("ln"));

    logger.info("Stopped all the senders.");

    // wait for senders to stop
    vm4.invoke(waitForSenderNonRunnable());
    vm5.invoke(waitForSenderNonRunnable());

    createReceiverInVMs(vm2, vm3);

    AsyncInvocation<Void> inv1 = vm4.invokeAsync(startSenderRunnable());
    AsyncInvocation<Void> inv2 = vm5.invokeAsync(startSenderRunnable());

    inv1.get();
    inv2.get();

    logger.info("Waiting for senders running.");
    // wait for senders running
    vm4.invoke(waitForSenderRunnable());
    vm5.invoke(waitForSenderRunnable());

    logger.info("All the senders are now running...");

    AsyncInvocation<Void> inv3 = vm4.invokeAsync(stopSenderRunnable());
    AsyncInvocation<Void> inv4 = vm5.invokeAsync(stopSenderRunnable());

    inv3.get();
    inv4.get();

    vm4.invoke(waitForSenderNonRunnable());
    vm5.invoke(waitForSenderNonRunnable());

    Integer localSize1 = vm4.invoke(() -> WANTestBase.getPRQLocalSize("ln"));
    Integer localSize2 = vm5.invoke(() -> WANTestBase.getPRQLocalSize("ln"));

    assertThat(localSize1 + localSize2).isEqualTo(1000);

    Integer regionSize1 = vm2.invoke(() -> WANTestBase.getRegionSize(getTestMethodName()));
    Integer regionSize2 = vm3.invoke(() -> WANTestBase.getRegionSize(getTestMethodName()));

    assertThat(regionSize1).isGreaterThan(0);
    assertThat(regionSize2).isGreaterThan(0);

    Integer vm4NumDuplicate = vm4.invoke(() -> WANTestBase.getNumOfPossibleDuplicateEvents("ln"));
    Integer vm5NumDuplicate = vm5.invoke(() -> WANTestBase.getNumOfPossibleDuplicateEvents("ln"));

    assertThat(vm4NumDuplicate + vm5NumDuplicate).isGreaterThan(100);

  }
When gateway senders starts to unqueue, stop gateway sender, and check that some evnts are
dispatched to receiving side,
but events are not removed on sending side.
geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java