@Test
  public void testPathUsage() throws Exception {
    CuratorFramework curator = newCurator();
    SlotZnode node1 = createZnode(curator),
        node2 = createZnode(curator), node3 = createZnode(curator);
    assertTrue(node1.start(30, TimeUnit.SECONDS));
    String path1 = node1.getActualPath();
    assertTrue(node2.start(30, TimeUnit.SECONDS));
    String path2 = node2.getActualPath();
    assertFalse(path1.equals(path2));
    node1.close();
    // Path must be reused.
    assertTrue(node3.start(30, TimeUnit.SECONDS));
    assertTrue(path1.equals(node3.getActualPath()));
  }
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