@Test
  // See GEODE-7079: a NullPointerException was thrown whenever the queue was recovered from disk
  // and the processor started dispatching events before the actual region was available.
  public void replicatedRegionWithPersistentSerialAsyncEventQueueAndConflationEnabledShouldNotLooseEventsNorThrowNullPointerExceptionsWhenMemberIsRestartedWhileEventsAreStillOnTheQueue()
      throws IOException {
    // Custom Log File to manually search for exceptions.
    File customLogFile = temporaryFolder.newFile("memberLog.log");
    Properties dsProperties = getDistributedSystemProperties();
    dsProperties.setProperty(ConfigurationProperties.LOG_FILE, customLogFile.getAbsolutePath());

    // Create Region, AsyncEventQueue and Insert Some Entries.
    vm0.invoke(() -> {
      createCache();
      // Large batch time interval and low batch size so no events are processed before the restart.
      createPersistentAsyncEventQueue(asyncEventQueueId, new SpyAsyncEventListener(), true, 10,
          createDiskStoreName(asyncEventQueueId), true, dispatcherThreadCount, 100, 120000);
      createReplicateRegion(replicateRegionName, asyncEventQueueId);
      doPuts(replicateRegionName, 5);
      waitForAsyncEventQueueSize(5);
    });

    vm0.invoke(() -> {
      // Restart the cache.
      getCache().close();
      cacheRule.createCache(dsProperties);

      // Recover the queue from disk, reduce thresholds so processing starts right away.
      SpyAsyncEventListener spyAsyncEventListener = new SpyAsyncEventListener();
      createPersistentAsyncEventQueue(asyncEventQueueId, spyAsyncEventListener, true, 5,
          createDiskStoreName(asyncEventQueueId), true, dispatcherThreadCount, 100,
          DEFAULT_BATCH_TIME_INTERVAL);
      waitForSenderToBecomePrimary();

      // Wait for the processors to start.
      await().until(() -> {
        Set<Thread> threads = Thread.getAllStackTraces().keySet();
        return threads
            .stream()
            .filter(t -> t.getName().contains("Processor for GatewaySender_AsyncEventQueue"))
            .allMatch(Thread::isAlive);
      });

      // Create the region, processing will continue and no NPE should be thrown anymore.
      createReplicateRegion(replicateRegionName, asyncEventQueueId);
      waitForRegionQueuesToEmpty();
      assertThat(spyAsyncEventListener.getEventsMap().size()).isEqualTo(5);
    });

    Files.lines(customLogFile.toPath()).forEach((line) -> assertThat(line)
        .as("Dispatcher shouldn't have thrown any errors while processing batches")
        .doesNotContain("An Exception occurred. The dispatcher will continue.")
        .doesNotContain("java.lang.NullPointerException"));
  }
There are 3 VMs in the site and the VM with primary sender is shut down.

<p>
TODO: fix this test
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/asyncqueue/AsyncEventListenerDistributedTest.java