private static ZooKeeperRegistrationSpec fillAndCreateNewRegistrationSpec(
            ZooKeeperRegistrationSpec spec, Server server) {
        if (spec instanceof LegacyZooKeeperRegistrationSpec) {
            return legacySpec(spec, server);
        }
        if (spec instanceof CuratorRegistrationSpec) {
            return curatorSpec(((CuratorRegistrationSpec) spec).serviceInstance(), server);
        }
        if (spec instanceof ServerSetsRegistrationSpec) {
            return serverSetsSpec((ServerSetsRegistrationSpec) spec, server);
        }
        return spec;
    }
Returns a {@link ZooKeeperUpdatingListenerBuilder} with a ZooKeeper connection string and a znode path.

@param zkConnectionStr the ZooKeeper connection string
@param znodePath the ZooKeeper node to register
@param spec the {@link ZooKeeperRegistrationSpec} to encode and register the {@link Server}
zookeeper3/src/main/java/com/linecorp/armeria/server/zookeeper/ZooKeeperUpdatingListener.java