ModuleBuilder extends AbstractBuilder<ModuleConfig, ModuleBuilder> { public ModuleBuilder addRegistry(RegistryConfig registry) { if (this.registries == null) { this.registries = new ArrayList<>(); } this.registries.add(registry); return getThis(); }  ModuleBuilder name(String name); ModuleBuilder version(String version); ModuleBuilder owner(String owner); ModuleBuilder organization(String organization); ModuleBuilder addRegistries(List<? extends RegistryConfig> registries); ModuleBuilder addRegistry(RegistryConfig registry); ModuleBuilder monitor(MonitorConfig monitor); ModuleBuilder isDefault(Boolean isDefault); ModuleConfig build();  }
@Test void addRegistry() { RegistryConfig registry = new RegistryConfig(); ModuleBuilder builder = new ModuleBuilder(); builder.addRegistry(registry); Assertions.assertTrue(builder.build().getRegistries().contains(registry)); Assertions.assertEquals(1, builder.build().getRegistries().size()); }