@Test
  public void shouldNotLeaveNativeSessionInContainer()
      throws Exception {
    manager.startAllInactiveContainers();

    String key = "value_testSessionExpiration";
    String value = "Foo";

    client.setPort(Integer.parseInt(manager.getContainerPort(0)));
    Client.Response resp = client.set(key, value);
    String cookie = resp.getSessionCookie();

    for (int i = 0; i < manager.numContainers(); i++) {
      client.setPort(Integer.parseInt(manager.getContainerPort(i)));
      resp = client.get(key);

      assertEquals("Sessions are not replicating properly", cookie, resp.getSessionCookie());
      assertEquals(value, resp.getResponse());
    }

    for (int i = 0; i < manager.numContainers(); i++) {
      client.setPort(Integer.parseInt(manager.getContainerPort(i)));
      resp = client.executionFunction(GetSessionCount.class);
      assertEquals("Should have 0 native sessions", "0", resp.getResponse());
    }
  }
Test that we don't leave native sessions in the container, wasting memory
geode-assembly/src/distributedTest/java/org/apache/geode/session/tests/GenericAppServerClientServerTest.java