@Override
    public void build(T instance) {
        super.build(instance);

        if (!StringUtils.isEmpty(version)) {
            instance.setVersion(version);
        }
        if (!StringUtils.isEmpty(group)) {
            instance.setGroup(group);
        }
        if (deprecated != null) {
            instance.setDeprecated(deprecated);
        }
        if (delay != null) {
            instance.setDelay(delay);
        }
        if (export != null) {
            instance.setExport(export);
        }
        if (weight != null) {
            instance.setWeight(weight);
        }
        if (!StringUtils.isEmpty(document)) {
            instance.setDocument(document);
        }
        if (dynamic != null) {
            instance.setDynamic(dynamic);
        }
        if (!StringUtils.isEmpty(token)) {
            instance.setToken(token);
        }
        if (!StringUtils.isEmpty(accesslog)) {
            instance.setAccesslog(accesslog);
        }
        if (protocols != null) {
            instance.setProtocols(protocols);
        }
        if (!StringUtils.isEmpty(protocolIds)) {
            instance.setProtocolIds(protocolIds);
        }
        if (executes != null) {
            instance.setExecutes(executes);
        }
        if (register != null) {
            instance.setRegister(register);
        }
        if (warmup != null) {
            instance.setWarmup(warmup);
        }
        if (!StringUtils.isEmpty(serialization)) {
            instance.setSerialization(serialization);
        }
        if (executor != null) {
            instance.setExecutor(executor);
        }
        if (StringUtils.isNotBlank(preferSerialization)) {
            instance.setPreferSerialization(preferSerialization);
        }
    }
@Test
    void build() {
        ProtocolConfig protocol = new ProtocolConfig();

        ServiceBuilder builder = new ServiceBuilder();
        builder.version("version")
                .group("group")
                .deprecated(true)
                .delay(1000)
                .export(false)
                .weight(1)
                .document("document")
                .dynamic(true)
                .token("token")
                .accesslog("accesslog")
                .addProtocol(protocol)
                .protocolIds("protocolIds")
                .tag("tag")
                .executes(100)
                .register(false)
                .warmup(200)
                .serialization("serialization")
                .id("id");

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

        Assertions.assertEquals("id", config.getId());
        Assertions.assertEquals("version", config.getVersion());
        Assertions.assertEquals("group", config.getGroup());
        Assertions.assertEquals("document", config.getDocument());
        Assertions.assertEquals("token", config.getToken());
        Assertions.assertEquals("accesslog", config.getAccesslog());
        Assertions.assertEquals("protocolIds", config.getProtocolIds());
        Assertions.assertEquals("tag", config.getTag());
        Assertions.assertEquals("serialization", config.getSerialization());
        Assertions.assertTrue(config.isDeprecated());
        Assertions.assertFalse(config.getExport());
        Assertions.assertTrue(config.isDynamic());
        Assertions.assertFalse(config.isRegister());
        Assertions.assertEquals(1000, config.getDelay());
        Assertions.assertEquals(1, config.getWeight());
        Assertions.assertEquals(100, config.getExecutes());
        Assertions.assertEquals(200, config.getWarmup());

        Assertions.assertNotSame(config, config2);
    }