AbstractReferenceBuilder extends AbstractInterfaceBuilder<T, B> { @Override public void build(T instance) { super.build(instance); if (check != null) { instance.setCheck(check); } if (init != null) { instance.setInit(init); } if (!StringUtils.isEmpty(generic)) { instance.setGeneric(generic); } if (injvm != null) { instance.setInjvm(injvm); } if (lazy != null) { instance.setLazy(lazy); } if (!StringUtils.isEmpty(reconnect)) { instance.setReconnect(reconnect); } if (sticky != null) { instance.setSticky(sticky); } if (!StringUtils.isEmpty(version)) { instance.setVersion(version); } if (!StringUtils.isEmpty(group)) { instance.setGroup(group); } }  B check(Boolean check); B init(Boolean init); B generic(String generic); B generic(Boolean generic); @Deprecated B injvm(Boolean injvm); B lazy(Boolean lazy); B reconnect(String reconnect); B sticky(Boolean sticky); B version(String version); B group(String group); @Override void build(T instance);  }
@Test void build() { ReferenceBuilder builder = new ReferenceBuilder(); builder.check(true).init(false).generic(true).injvm(false).lazy(true).reconnect("reconnect").sticky(false) .version("version").group("group").id("id").prefix("prefix"); ReferenceConfig config = builder.build(); ReferenceConfig config2 = builder.build(); Assertions.assertEquals("id", config.getId()); Assertions.assertEquals("prefix", config.getPrefix()); Assertions.assertTrue(config.isCheck()); Assertions.assertFalse(config.isInit()); Assertions.assertTrue(config.isGeneric()); Assertions.assertFalse(config.isInjvm()); Assertions.assertTrue(config.getLazy()); Assertions.assertFalse(config.getSticky()); Assertions.assertEquals("reconnect", config.getReconnect()); Assertions.assertEquals("version", config.getVersion()); Assertions.assertEquals("group", config.getGroup()); Assertions.assertNotSame(config, config2); }