@Test
  public void testRefCountForDestroy() throws Exception {
    // slow start for dispatcher
    serverVM0.invoke(() -> ConflationDistributedTestHelper.setIsSlowStart("30000"));
    serverVM1.invoke(() -> ConflationDistributedTestHelper.setIsSlowStart("30000"));

    createClientCache(getServerHostName(), PORT1, PORT2,
        "1");
    final String client1Host = getServerHostName();
    clientVM1.invoke(() -> HARQueueNewImplDistributedTest.createClientCache(client1Host,
        PORT1, PORT2, "1"));
    final String client2Host = getServerHostName();
    clientVM2.invoke(() -> HARQueueNewImplDistributedTest.createClientCache(client2Host,
        PORT1, PORT2, "1"));

    registerInterestListAll();
    clientVM1.invoke(HARQueueNewImplDistributedTest::registerInterestList);
    clientVM2.invoke(HARQueueNewImplDistributedTest::registerInterestList);
    // 1. stop the second server
    serverVM1.invoke(HARQueueNewImplDistributedTest::stopServer);

    serverVM0.invoke((SerializableRunnableIF) HARQueueNewImplDistributedTest::createEntries);
    // 3. start the second server.
    serverVM1.invoke(HARQueueNewImplDistributedTest::startServer);
    Thread.sleep(3000);

    clientVM1.invoke(HARQueueNewImplDistributedTest::closeCache);

    Thread.sleep(1000);
    serverVM0.invoke(HARQueueNewImplDistributedTest::updateMap1);
    serverVM1.invoke(HARQueueNewImplDistributedTest::updateMap1);

    serverVM0.invoke(() -> HARQueueNewImplDistributedTest.verifyQueueData(
        PORT1));
    serverVM1.invoke(() -> HARQueueNewImplDistributedTest.verifyQueueData(
        PORT2));

    clientVM2.invoke(HARQueueNewImplDistributedTest::closeCache);

    serverVM0.invoke(HARQueueNewImplDistributedTest::updateMap2);
    serverVM1.invoke(HARQueueNewImplDistributedTest::updateMap2);

    Thread.sleep(1000);
    serverVM0.invoke(() -> HARQueueNewImplDistributedTest.verifyQueueData(
        PORT1));
    serverVM1.invoke(() -> HARQueueNewImplDistributedTest.verifyQueueData(
        PORT2));
  }
This test verifies that the destruction of a ha-region (caused by proxy/client disconnect),
causes the reference count of all HAEventWrapper instances belonging to the ha-region-queue to
be decremented by one, and makes it visible to the client-messages-region.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ha/HARQueueNewImplDistributedTest.java