@Test
  public void testRecreatesNodeWhenItGetsDeleted() throws Exception {
    CuratorFramework curator = newCurator();
    SlotZnode node = createZnode(curator);
    assertTrue(node.start(30, TimeUnit.SECONDS));
    String originalNode = node.getActualPath();
    assertNodeExists(curator, originalNode);
    // Delete the original node...
    curator.delete().forPath(originalNode);
    Trigger createdWatchTrigger = Trigger.created();
    Stat stat = curator.checkExists().usingWatcher(createdWatchTrigger).forPath(originalNode);
    assertTrue(stat != null || createdWatchTrigger.firedWithin(30, TimeUnit.SECONDS));
  }
See SlotZNode; some tests (and the setup) are c/p-ed or modified from Curator.
llap-client/src/test/org/apache/hadoop/hive/llap/registry/impl/TestSlotZnode.java