@Override
    public RegistryConfig build() {
        RegistryConfig registry = new RegistryConfig();
        super.build(registry);

        registry.setCheck(check);
        registry.setClient(client);
        registry.setCluster(cluster);
        registry.setDefault(isDefault);
        registry.setDynamic(dynamic);
        registry.setExtraKeys(extraKeys);
        registry.setFile(file);
        registry.setGroup(group);
        registry.setParameters(parameters);
        registry.setPassword(password);
        registry.setPort(port);
        registry.setProtocol(protocol);
        registry.setRegister(register);
        registry.setServer(server);
        registry.setSession(session);
        registry.setSimplified(simplified);
        registry.setSubscribe(subscribe);
        registry.setTimeout(timeout);
        registry.setTransporter(transporter);
        registry.setUsername(username);
        registry.setVersion(version);
        registry.setWait(wait);
        registry.setUseAsConfigCenter(useAsConfigCenter);
        registry.setUseAsMetadataCenter(useAsMetadataCenter);
        registry.setAccepts(accepts);
        registry.setPreferred(preferred);
        registry.setWeight(weight);
        registry.setAddress(address);

        return registry;
    }
@Test
    void build() {
        RegistryBuilder builder = new RegistryBuilder();
        builder.address("address")
                .username("username")
                .password("password")
                .port(8080)
                .protocol("protocol")
                .transporter("transporter")
                .server("server")
                .client("client")
                .cluster("cluster")
                .group("group")
                .version("version")
                .timeout(1000)
                .session(2000)
                .file("file")
                .wait(Integer.valueOf(10))
                .isCheck(true)
                .isDynamic(false)
                .register(true)
                .subscribe(false)
                .isDefault(true)
                .simplified(false)
                .extraKeys("A")
                .parameter("default.num", "one")
                .id("id");

        RegistryConfig config = builder.build();
        RegistryConfig config2 = builder.build();

        Assertions.assertEquals(8080, config.getPort());
        Assertions.assertEquals(1000, config.getTimeout());
        Assertions.assertEquals(2000, config.getSession());
        Assertions.assertEquals(10, config.getWait());
        Assertions.assertTrue(config.isCheck());
        Assertions.assertFalse(config.isDynamic());
        Assertions.assertTrue(config.isRegister());
        Assertions.assertFalse(config.isSubscribe());
        Assertions.assertTrue(config.isDefault());
        Assertions.assertFalse(config.getSimplified());
        Assertions.assertEquals("address", config.getAddress());
        Assertions.assertEquals("username", config.getUsername());
        Assertions.assertEquals("password", config.getPassword());
        Assertions.assertEquals("protocol", config.getProtocol());
        Assertions.assertEquals("transporter", config.getTransporter());
        Assertions.assertEquals("server", config.getServer());
        Assertions.assertEquals("client", config.getClient());
        Assertions.assertEquals("cluster", config.getCluster());
        Assertions.assertEquals("group", config.getGroup());
        Assertions.assertEquals("version", config.getVersion());
        Assertions.assertEquals("file", config.getFile());
        Assertions.assertEquals("A", config.getExtraKeys());
        Assertions.assertTrue(config.getParameters().containsKey("default.num"));
        Assertions.assertEquals("one", config.getParameters().get("default.num"));
        Assertions.assertEquals("id", config.getId());
        Assertions.assertNotSame(config, config2);
    }