public static ConnectionSpec create(String spec) {
        return create(spec, spec);
    }
@Test
    public void create() {
        HostName.setHostNameForTestingOnly("host2");
        Config config = new Config(List.of(new Config.Server("host1", 10001),
                                           new Config.Server("host2", 10002),
                                           new Config.Server("host3", 10003)));

        {
            ConnectionSpec spec = ConnectionSpec.create(config.servers, Config.Server::hostname, Config.Server::port, false);
            assertEquals("host1:10001,host2:10002,host3:10003", spec.local());
            assertEquals("host1:10001,host2:10002,host3:10003", spec.ensemble());
            assertEquals(3, spec.ensembleSize());
        }

        {
            ConnectionSpec specLocalAffinity = ConnectionSpec.create(config.servers, Config.Server::hostname, Config.Server::port, true);
            assertEquals("host2:10002", specLocalAffinity.local());
            assertEquals("host1:10001,host2:10002,host3:10003", specLocalAffinity.ensemble());
            assertEquals(3, specLocalAffinity.ensembleSize());
        }

        {
            ConnectionSpec specFromString = ConnectionSpec.create("host1:10001", "host1:10001,host2:10002");
            assertEquals("host1:10001", specFromString.local());
            assertEquals("host1:10001,host2:10002", specFromString.ensemble());
            assertEquals(2, specFromString.ensembleSize());
        }
    }