// Add twice the same watcher on the same path
client.getData().usingWatcher(watcher).forPath(PATH);
client.getData().usingWatcher(watcher).forPath(PATH);
// Ok, let's test it
client.setData().forPath(PATH, new byte[]{});
timing.sleepABit();
Assert.assertEquals(1, watcher.count.get());
}
finally
{
Closeables.closeQuietly(client);