PersistentEphemeralNode node =
new PersistentEphemeralNode(mZKClient, Mode.EPHEMERAL, path, new byte[0]);
try {
node.start();
node.waitForInitialCreate(5, TimeUnit.SECONDS);
Assert.assertTrue(ZooKeeperUtils.atomicRecursiveDelete(mZKClient, "/foo"));
Thread.sleep(1000); // Give ephemeral node time to recreate itself
Assert.assertNotNull(mZKClient.checkExists().forPath("/foo"));
} finally {
node.close();