TimeLockClientConfigs { public static TimeLockClientConfig copyWithClient(TimeLockClientConfig config, String namespace) { return ImmutableTimeLockClientConfig.builder() .from(config) .client(namespace) .build(); } private  TimeLockClientConfigs(); static TimeLockClientConfig copyWithClient(TimeLockClientConfig config, String namespace);  }
@Test public void canCopyAddingClient() { TimeLockClientConfig newConfig = TimeLockClientConfigs.copyWithClient(CONFIG_WITHOUT_CLIENT, CLIENT_1); assertThat(newConfig.getClientOrThrow()).isEqualTo(CLIENT_1); }
@Test public void otherPropertiesConservedWhenAddingClient() { TimeLockClientConfig newConfig = TimeLockClientConfigs.copyWithClient(CONFIG_WITHOUT_CLIENT, CLIENT_1); assertThat(newConfig.serversList()).isEqualTo(SERVERS_LIST); }
@Test public void canCopyReplacingClient() { TimeLockClientConfig newConfig = TimeLockClientConfigs.copyWithClient(CONFIG_WITH_CLIENT, CLIENT_1); assertThat(newConfig.getClientOrThrow()).isEqualTo(CLIENT_1); }