@Test
public void testWithRetryInBackground() 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
            }
        };
        final CountDownLatch latch = new CountDownLatch(1);
        BackgroundCallback callback = new BackgroundCallback()
        {
            @Override
            public void processResult(CuratorFramework client, CuratorEvent event) throws Exception
            {
                latch.countDown();
            }
        };
        removerClient.checkExists().usingWatcher(w).inBackground(callback).forPath("/one/two/three");
        Assert.assertTrue(new Timing().awaitLatch(latch));
        Assert.assertEquals(removerClient.getWatcherRemovalManager().getEntries().size(), 0);
    }
    finally
    {
        TestCleanState.closeAndTestClean(client);
    }
}