@Test
  public void testDeadClientRemovalByServer() throws Exception {
    System.setProperty(ClientHealthMonitor.CLIENT_HEALTH_MONITOR_INTERVAL_PROPERTY, "100");
    PORT = createServer();
    createProxyAndRegionForClient();
    StatisticsType statisticsType = system.findType("CacheServerStats");
    final Statistics statistics = system.findStatisticsByType(statisticsType)[0];
    assertEquals(0, statistics.getInt("currentClients"));
    assertEquals(0, statistics.getInt("currentClientConnections"));
    system.getLogWriter()
        .info("beforeAcquireConnection clients=" + statistics.getInt("currentClients") + " cnxs="
            + statistics.getInt("currentClientConnections"));
    Connection connection1 = proxy.acquireConnection();
    system.getLogWriter()
        .info("afterAcquireConnection clients=" + statistics.getInt("currentClients") + " cnxs="
            + statistics.getInt("currentClientConnections"));
    system.getLogWriter().info("acquired connection " + connection1);

    await().pollDelay(0, TimeUnit.MILLISECONDS)
        .until(() -> statistics.getInt("currentClients") == 1);

    assertEquals(1, statistics.getInt("currentClients"));
    assertEquals(1, statistics.getInt("currentClientConnections"));
    ServerRegionProxy srp = new ServerRegionProxy("region1", proxy);

    srp.putOnForTestsOnly(connection1, "key-1", "value-1", new EventID(new byte[] {1}, 1, 1), null);
    system.getLogWriter().info("did put 1");

    await().pollDelay(0, TimeUnit.MILLISECONDS)
        .until(() -> statistics.getInt("currentClients") == 0);

    system.getLogWriter().info("currentClients=" + statistics.getInt("currentClients")
        + " currentClientConnections=" + statistics.getInt("currentClientConnections"));
    assertEquals(0, statistics.getInt("currentClients"));
    assertEquals(0, statistics.getInt("currentClientConnections"));

    // the connection should now fail since the server timed it out
    try {
      srp.putOnForTestsOnly(connection1, "key-1", "fail", new EventID(new byte[] {1}, 1, 2), null);
      fail("expected EOF");
    } catch (ServerConnectivityException ignored) {
    }
  }
This test performs the following:<br>
1)create server<br>
2)initialize proxy object and create region for client<br>
3)perform a PUT on client by acquiring Connection through proxy<br>
4)stop server monitor threads in client to ensure that server treats this as dead client <br>
5)wait for some time to allow server to clean up the dead client artifacts<br>
6)again perform a PUT on client through same Connection and verify after the put that the
Connection object used was new one.
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/tier/sockets/ClientHealthMonitorIntegrationTest.java