@Test
  public void testpersistentWanGateway_CheckReceiverPossibleDuplicate_afterSenderRestarted() {
    int lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(localId));
    int nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(remoteId, lnPort));
    createCacheInVMs(nyPort, vm2, vm3);

    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);

    // keep a larger batch to minimize number of exception occurrences in the log
    vm4.invoke(
        () -> WANTestBase.createSender("ln", remoteId, true, 100, 10, false, true, null, false));
    vm5.invoke(
        () -> WANTestBase.createSender("ln", remoteId, true, 100, 10, false, true, null, false));
    vm6.invoke(
        () -> WANTestBase.createSender("ln", remoteId, true, 100, 10, false, true, null, false));
    vm7.invoke(
        () -> WANTestBase.createSender("ln", remoteId, 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()));
    vm6.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), "ln", 1,
        100, isOffHeap()));
    vm7.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));

    // Just making sure that though the remote site is started later,
    // remote site is still able to get the data. Since the receivers are
    // started before creating partition region it is quite possible that the
    // region may loose some of the events. This needs to be handled by the code

    vm5.invoke(() -> WANTestBase.killSender());

    createReceiverInVMs(vm2, vm3);

    vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName(), 1000));
    vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName(), 1000));

    long vm2NumDuplicate = vm2.invoke(() -> WANTestBase.getReceiverStats().get(7));
    long vm3NumDuplicate = vm3.invoke(() -> WANTestBase.getReceiverStats().get(7));

    assertThat(vm2NumDuplicate + vm3NumDuplicate).isEqualTo(40);
  }
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/ParallelWANPersistenceEnabledGatewaySenderCheckPossibleDuplicateDUnitTest.java