@Test
public void testKilledSession() throws Exception
{

    client.create().forPath("/test");
    cache = newTreeCacheWithListeners(client, "/test");
    cache.start();
    assertEvent(TreeCacheEvent.Type.NODE_ADDED, "/test");
    assertEvent(TreeCacheEvent.Type.INITIALIZED);
    client.create().forPath("/test/foo", "foo".getBytes());
    assertEvent(TreeCacheEvent.Type.NODE_ADDED, "/test/foo");
    client.create().withMode(CreateMode.EPHEMERAL).forPath("/test/me", "data".getBytes());
    assertEvent(TreeCacheEvent.Type.NODE_ADDED, "/test/me");
    Compatibility.injectSessionExpiration(client.getZookeeperClient().getZooKeeper());
    assertEvent(TreeCacheEvent.Type.NODE_REMOVED, "/test/me", "data".getBytes(), true);
    assertEvent(TreeCacheEvent.Type.INITIALIZED, null, null, true);
    assertNoMoreEvents();
}