ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder addRegistries(List<? extends RegistryConfig> registries) { if (this.registries == null) { this.registries = new ArrayList<>(); } this.registries.addAll(registries); return getThis(); }  static ApplicationBuilder newBuilder(); ApplicationBuilder name(String name); ApplicationBuilder metadata(String metadata); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); ApplicationBuilder organization(String organization); ApplicationBuilder architecture(String architecture); ApplicationBuilder environment(String environment); ApplicationBuilder compiler(String compiler); ApplicationBuilder logger(String logger); ApplicationBuilder addRegistry(RegistryConfig registry); ApplicationBuilder addRegistries(List<? extends RegistryConfig> registries); ApplicationBuilder registryIds(String registryIds); ApplicationBuilder monitor(MonitorConfig monitor); ApplicationBuilder monitor(String monitor); ApplicationBuilder isDefault(Boolean isDefault); ApplicationBuilder dumpDirectory(String dumpDirectory); ApplicationBuilder qosEnable(Boolean qosEnable); ApplicationBuilder qosPort(Integer qosPort); ApplicationBuilder qosAcceptForeignIp(Boolean qosAcceptForeignIp); ApplicationBuilder shutwait(String shutwait); ApplicationBuilder appendParameter(String key, String value); ApplicationBuilder appendParameters(Map<String, String> appendParameters); ApplicationBuilder metadataServicePort(Integer metadataServicePort); ApplicationConfig build();  }
@Test void addRegistries() { RegistryConfig registry = new RegistryConfig(); ApplicationBuilder builder = new ApplicationBuilder(); builder.addRegistries(Collections.singletonList(registry)); Assertions.assertNotNull(builder.build().getRegistry()); Assertions.assertEquals(1, builder.build().getRegistries().size()); Assertions.assertSame(registry, builder.build().getRegistry()); }