private void closeProxyAndVerifyHARegionQueueStatsAreClosed() {
    assertThat(cacheRule.getCache().getCacheServers()).hasSize(1);

    InternalCacheServer cacheServer =
        (InternalCacheServer) cacheRule.getCache().getCacheServers().iterator().next();

    assertThat(cacheServer).isNotNull();
    assertThat(cacheServer.getAcceptor()).isNotNull();
    assertThat(cacheServer.getAcceptor().getCacheClientNotifier()).isNotNull();

    Iterator proxies =
        cacheServer.getAcceptor().getCacheClientNotifier().getClientProxies().iterator();

    assertThat(proxies.hasNext()).isTrue();

    CacheClientProxy proxy = (CacheClientProxy) proxies.next();
    Map dispatchedMsgMap = HARegionQueue.getDispatchedMessagesMapForTesting();
    HARegionQueue haRegionQueue = proxy.getHARegionQueue();

    assertThat(dispatchedMsgMap.get(haRegionQueue.getRegion().getName())).isNotNull();
    assertThat(haRegionQueue.getStatistics().isClosed()).isFalse();

    proxy.close();

    assertThat(haRegionQueue.getStatistics().isClosed()).isTrue();
  }
Close the CacheClientProxy of the client on the server and verify that ha-stats are closed and
the entry for the region is removed from dispatchedMessagesMap.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/HARegionQueueStatsCloseRegressionTest.java