@Test
  public void testStopStartPersistentParallelAndSerialAsyncEventQueues() {
    // Create cache
    vm0.invoke(this::createCache);
    vm1.invoke(this::createCache);
    vm2.invoke(this::createCache);
    vm3.invoke(this::createCache);

    // Create several serial and parallel AEQs
    int numAEQs = 3;
    vm0.invoke(() -> createAsyncEventQueues(numAEQs));
    vm1.invoke(() -> createAsyncEventQueues(numAEQs));
    vm2.invoke(() -> createAsyncEventQueues(numAEQs));
    vm3.invoke(() -> createAsyncEventQueues(numAEQs));

    // Create replicated and partitioned regions attached to those AEQs
    int numRegions = 3;
    vm0.invoke(() -> createRegions(numRegions));
    vm1.invoke(() -> createRegions(numRegions));
    vm2.invoke(() -> createRegions(numRegions));
    vm3.invoke(() -> createRegions(numRegions));

    // Do puts into all replicated and partitioned regions
    vm0.invoke(() -> doPuts(numRegions, 1000));

    // Wait for all AEQs to be empty
    vm0.invoke(this::waitForAsyncQueuesToEmpty);
    vm1.invoke(this::waitForAsyncQueuesToEmpty);
    vm2.invoke(this::waitForAsyncQueuesToEmpty);
    vm3.invoke(this::waitForAsyncQueuesToEmpty);

    // Stop all AEQs
    vm0.invoke(this::stopAsyncQueues);
    vm1.invoke(this::stopAsyncQueues);
    vm2.invoke(this::stopAsyncQueues);
    vm3.invoke(this::stopAsyncQueues);

    // Start all AEQs
    AsyncInvocation<Void> startAeqsVm0 = vm0.invokeAsync(this::startAsyncQueues);
    AsyncInvocation<Void> startAeqsVm1 = vm1.invokeAsync(this::startAsyncQueues);
    AsyncInvocation<Void> startAeqsVm2 = vm2.invokeAsync(this::startAsyncQueues);
    AsyncInvocation<Void> startAeqsVm3 = vm3.invokeAsync(this::startAsyncQueues);

    // Wait for async tasks to complete
    ThreadUtils.join(startAeqsVm0, 120 * 1000);
    ThreadUtils.join(startAeqsVm1, 120 * 1000);
    ThreadUtils.join(startAeqsVm2, 120 * 1000);
    ThreadUtils.join(startAeqsVm3, 120 * 1000);
  }
Override as needed to add to the configuration, such as regionFactory.setOffHeap(boolean).
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/asyncqueue/ParallelSerialAsyncEventListenerStopStartDistributedTest.java