class ZkBasedTreeNodeResource implements Closeable {

    @Override
    public void close() {
        synchronized (lock) {
            if (resource != null && cleanup != null) {
                cleanup.test(resource);
            }
            if (treeCache != null) {
                treeCache.close();
            }
            closed = true;
        }
    }

    private  ZkBasedTreeNodeResource(Builder<T> builder);

}