@Override
    public void getConfig(ZookeeperServerConfig.Builder builder) {
        ConfigServer[] configServers = getConfigServers();
        int[] zookeeperIds = getConfigServerZookeeperIds();

        if (configServers.length != zookeeperIds.length) {
            throw new IllegalArgumentException(String.format("Number of provided config server hosts (%d) must be the " +
                    "same as number of provided config server zookeeper ids (%d)",
                    configServers.length, zookeeperIds.length));
        }

        String myhostname = HostName.getLocalhost();
        // TODO: Server index should be in interval [1, 254] according to doc,
        // however, we cannot change this id for an existing server
        for (int i = 0; i < configServers.length; i++) {
            if (zookeeperIds[i] < 0) {
                throw new IllegalArgumentException(String.format("Zookeeper ids cannot be negative, was %d for %s",
                        zookeeperIds[i], configServers[i].hostName));
            }
            if (configServers[i].hostName.equals(myhostname)) {
                builder.myid(zookeeperIds[i]);
            }
            builder.server(getZkServer(configServers[i], zookeeperIds[i]));
        }

        if (options.zookeeperClientPort().isPresent()) {
            builder.clientPort(options.zookeeperClientPort().get());
        }
        if (options.hostedVespa().orElse(false)) {
            builder.vespaTlsConfigFile(Defaults.getDefaults().underVespaHome("var/zookeeper/conf/tls.conf.json"));
        }

        boolean isHostedVespa = options.hostedVespa().orElse(false);
        builder.dynamicReconfiguration(isHostedVespa);
        builder.reconfigureEnsemble(!isHostedVespa);
        builder.snapshotMethod(options.zooKeeperSnapshotMethod());
        builder.juteMaxBuffer(options.zookeeperJuteMaxBuffer());
    }
@Test
    void zookeeperConfig_uneven_number_of_config_servers_and_zk_ids() {
        assertThrows(IllegalArgumentException.class, () -> {
            TestOptions testOptions = createTestOptions(List.of("cfg1", "localhost", "cfg3"), List.of(1));
            getConfig(ZookeeperServerConfig.class, testOptions);
        });
    }