private ZookeeperServerConfig createConfig(int numberOfServers, boolean dynamicReconfiguration, int... retiredIndices) {
        Arrays.sort(retiredIndices);
        ZookeeperServerConfig.Builder builder = new ZookeeperServerConfig.Builder();
        builder.zooKeeperConfigFile(cfgFile.getAbsolutePath());
        builder.myidFile(idFile.getAbsolutePath());
        for (int i = 0, index = 0; i < numberOfServers; i++, index++) {
            boolean retired = Arrays.binarySearch(retiredIndices, index) >= 0;
            if (retired) i--;
            builder.server(newServer(i, "node" + index, retired));
        }

        builder.myid(0);
        builder.dynamicReconfiguration(dynamicReconfiguration);
        return builder.build();
    }
Tests dynamic reconfiguration of zookeeper cluster.

@author hmusum
zookeeper-server/zookeeper-server-common/src/test/java/com/yahoo/vespa/zookeeper/ReconfigurerTest.java