@Override
    public void addNode(String path, byte[] data) {
        if ((nodes.get(path) != null) && nodes.get(path).exists()) {
            throw new IllegalStateException("Node '" + path
                    + "' already exists");
        }

        if ((nodes.get(getParent(path)) == null)
                || !nodes.get(getParent(path)).exists()) {
            throw new IllegalArgumentException("Node '" + path
                    + "' can't be created. Its parent node doesn't exist");
        }

        try {
            zk.create(path, data,
                    org.apache.zookeeper.ZooDefs.Ids.OPEN_ACL_UNSAFE,
                    CreateMode.PERSISTENT);
        } catch (KeeperException e) {
            e.printStackTrace();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }