@Test
    public void containerWithZooKeeperJoiningServers() {
        Function<Integer, String> servicesXml = (nodeCount) -> {
            return "<?xml version='1.0' encoding='utf-8' ?>" +
                   "<services>" +
                   "  <container version='1.0' id='zk'>" +
                   "     <zookeeper/>" +
                   "     <nodes count='" + nodeCount + "'/>" +
                   "  </container>" +
                   "</services>";
        };
        VespaModelTester tester = new VespaModelTester();
        tester.addHosts(5);
        VespaModel model = tester.createModel(servicesXml.apply(3), true, deployStateWithClusterEndpoints("zk"));

        {
            ApplicationContainerCluster cluster = model.getContainerClusters().get("zk");
            ZookeeperServerConfig.Builder config = new ZookeeperServerConfig.Builder();
            cluster.getContainers().forEach(c -> c.getConfig(config));
            cluster.getConfig(config);
            assertTrue(config.build().server().stream().noneMatch(ZookeeperServerConfig.Server::joining), "Initial servers are not joining");
        }
        {
            VespaModel nextModel = tester.createModel(Zone.defaultZone(), servicesXml.apply(3), true, false, false, NodeResources.unspecified(), 0, Optional.of(model), deployStateWithClusterEndpoints("zk"), "node-1-3-50-04", "node-1-3-50-03");
            ApplicationContainerCluster cluster = nextModel.getContainerClusters().get("zk");
            ZookeeperServerConfig.Builder config = new ZookeeperServerConfig.Builder();
            cluster.getContainers().forEach(c -> c.getConfig(config));
            cluster.getConfig(config);
            assertEquals(Map.of(0, false,
                                1, false,
                                2, false,
                                3, true,
                                4, true),
                         config.build().server().stream().collect(Collectors.toMap(ZookeeperServerConfig.Server::id,
                                                                                   ZookeeperServerConfig.Server::joining)),
                         "New nodes are joining");
            assertEquals(Map.of(0, false,
                                1, true,
                                2, true,
                                3, false,
                                4, false),
                         config.build().server().stream().collect(Collectors.toMap(ZookeeperServerConfig.Server::id,
                                                                                   ZookeeperServerConfig.Server::retired)),
                         "Retired nodes are retired");
        }
    }
Recreate the combination used in some factory tests
config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java