@Test
  public void testDurableClientExit_ServerExpressedInterest_NonDurableInterest() throws Exception {
    final Host host = getHost(0);
    final VM serverVM = host.getVM(0);
    final VM clientVM_1 = host.getVM(1);
    final VM clientVM_2 = host.getVM(2);
    final VM clientVM_3 = host.getVM(3);

    serverVM.invoke(InterestRegrListenerDUnitTest::setUpServerVMTask);
    serverVM.invoke(InterestRegrListenerDUnitTest::createServerTask);

    Object[] array = serverVM
        .invoke(InterestRegrListenerDUnitTest::getCacheServerEndPointTask);
    String hostName = (String) array[0];
    int port = (Integer) array[1];
    Object[] params = new Object[4];
    params[0] = hostName;
    params[1] = port;
    params[2] = true;
    params[3] = "VM_1";
    getLogWriter()
        .info("Starting client1 with server endpoint <" + hostName + ">:" + port);
    clientVM_1.invoke(InterestRegrListenerDUnitTest.class, "setUpClientVMTask", params);

    params[3] = "VM_2";
    getLogWriter()
        .info("Starting client2 with server endpoint <" + hostName + ">:" + port);
    clientVM_2.invoke(InterestRegrListenerDUnitTest.class, "setUpClientVMTask", params);

    params[3] = "VM_3";
    getLogWriter()
        .info("Starting client2 with server endpoint <" + hostName + ">:" + port);
    clientVM_3.invoke(InterestRegrListenerDUnitTest.class, "setUpClientVMTask", params);


    params = new Object[1];
    params[0] = false; // non-durable interest

    serverVM.invoke(InterestRegrListenerDUnitTest::doRegisterListenerTask);
    serverVM.invoke(InterestRegrListenerDUnitTest.class, "doExpressInterestOnServerTask", params);

    clientVM_1.invoke(InterestRegrListenerDUnitTest::doClientRegionPutTask);
    clientVM_2.invoke(InterestRegrListenerDUnitTest::doClientRegionPutTask);
    clientVM_3.invoke(InterestRegrListenerDUnitTest::doClientRegionPutTask);
    serverVM.invoke(InterestRegrListenerDUnitTest::doServerRegionPutTask);

    clientVM_1.invoke(() -> closeClientCacheTask(false));
    clientVM_2.invoke(() -> closeClientCacheTask(false));
    clientVM_3.invoke(() -> closeClientCacheTask(false));

    sleep(2);

    WaitCriterion wc = new WaitCriterion() {
      int registerCount = 0;
      int unregisterCount = 0;

      @Override
      public boolean done() {
        Map<String, Integer> listnerMap = serverVM
            .invoke(InterestRegrListenerDUnitTest::getListenerMapTask);
        getLogWriter().info("Listener Map " + listnerMap);
        registerCount = getMapValueForKey(listnerMap, REGISTER_INTEREST);
        unregisterCount = getMapValueForKey(listnerMap, UNREGISTER_INTEREST);
        if (registerCount == 3 && unregisterCount == 3) {
          return true;
        }
        getLogWriter()
            .info("Waiting for counts to each reach 3.  Current registerCount=" + registerCount
                + "; unregisterCount=" + unregisterCount);
        return false;
      }

      @Override
      public String description() {
        return "Waiting for counts to each reach 3.  Current registerCount=" + registerCount
            + "; unregisterCount=" + unregisterCount;
      }
    };

    GeodeAwaitility.await().untilAsserted(wc);

    getLogWriter().info(
        "Sleeping till durable client queue are expired and unregister event is called on to listener");
    sleep((DURABLE_CLIENT_TIMEOUT_TEST + 5) * 1000);
    serverVM.invoke(InterestRegrListenerDUnitTest::closeCacheTask);
  }
Written to test fix for Bug #47132
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/InterestRegrListenerDUnitTest.java