private SlotZnode createZnode(CuratorFramework curator) throws Exception {
    if (curator.checkExists().forPath(PATH) == null) {
      curator.create().creatingParentsIfNeeded().forPath(PATH);
    }
    SlotZnode result = new SlotZnode(curator, PATH, "slot-", "worker-", "");
    createdNodes.add(result);
    return result;
  }
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