@Test
public void testTriggered() throws Exception
{

    CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
    try
    {
        client.start();
        WatcherRemovalFacade removerClient = (WatcherRemovalFacade)client.newWatcherRemoveCuratorFramework();
        final CountDownLatch latch = new CountDownLatch(1);
        Watcher watcher = new Watcher()
        {
            @Override
            public void process(WatchedEvent event)
            {
                if ( event.getType() == Event.EventType.NodeCreated )
                {
                    latch.countDown();
                }
            }
        };
        removerClient.checkExists().usingWatcher(watcher).forPath("/yo");
        Assert.assertEquals(removerClient.getRemovalManager().getEntries().size(), 1);
        removerClient.create().forPath("/yo");
        Assert.assertTrue(new Timing().awaitLatch(latch));
        Assert.assertEquals(removerClient.getRemovalManager().getEntries().size(), 0);
    }
    finally
    {
        TestCleanState.closeAndTestClean(client);
    }
}