@Test
public void testWithRetry() throws Exception
{

    server.stop();
    CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
    try
    {
        client.start();
        WatcherRemovalFacade removerClient = (WatcherRemovalFacade)client.newWatcherRemoveCuratorFramework();
        Watcher w = new Watcher()
        {
            @Override
            public void process(WatchedEvent event)
            {
                // NOP
            }
        };
        try
        {
            removerClient.checkExists().usingWatcher(w).forPath("/one/two/three");
            Assert.fail("Should have thrown ConnectionLossException");
        }
        catch ( KeeperException.ConnectionLossException expected )
        {
            // expected
        }
        Assert.assertEquals(removerClient.getWatcherRemovalManager().getEntries().size(), 0);
    }
    finally
    {
        TestCleanState.closeAndTestClean(client);
    }
}