code: public static void createIfNotExists(
        CuratorFramework curatorFramework,
        String path,
        CreateMode mode,
        byte[] rawBytes,
        int maxZnodeBytes
    ) throws Exception
    {
      verifySize(path, rawBytes, maxZnodeBytes);
  
      if (curatorFramework.checkExists().forPath(path) == null) {
        try {
          curatorFramework.create()
                          .creatingParentsIfNeeded()
                          .withMode(mode)
                          .forPath(path, rawBytes);
        }
        catch (KeeperException.NodeExistsException e) {
          log.info("Skipping create path[%s], since it already exists.", path);
        }
      }
    }
docs: Create znode if it does not already exist. If it does already exist, this does nothing. In particular, the
  existing znode may have a different payload or create mode.
  
  @param curatorFramework curator
  @param path             path
  @param mode             create mode
  @param rawBytes         payload
  @param maxZnodeBytes    maximum payload size
  
  @throws IllegalArgumentException if rawBytes.length > maxZnodeBytes
  @throws Exception                if Curator throws an Exception