code: public String createNode(final String path, final boolean watch, final boolean ephimeral) {
  		String createdNodePath = null;
  		try {
  
  			final Stat nodeStat =  zooKeeper.exists(path, watch);
  
  			if(nodeStat == null) {
  				createdNodePath = zooKeeper.create(path, new byte[0], Ids.OPEN_ACL_UNSAFE, (ephimeral ?  CreateMode.EPHEMERAL_SEQUENTIAL : CreateMode.PERSISTENT));
  			} else {
  				createdNodePath = path;
  			}
  
  		} catch (KeeperException | InterruptedException e) {
  			throw new IllegalStateException(e);
  		}
  
  		return createdNodePath;
  	}
docs: Create a zookeeper node
  
  @param  path 			The path of znode to create
  @param  watch			Whether to watch this node or not
  @param  ephimeral		Create ephemeral or permanent node
  @return	The created node path