### Question:
ClientProperties { public boolean isAutoDeregistration(Environment environment) { return (this.autoDeregistration != null) ? this.autoDeregistration : (CloudPlatform.getActive(environment) != null); }  String[] getAdminUrl(); boolean isAutoDeregistration(Environment environment);  }### Answer:
@Test public void should_default_autoDeregister_to_false() { MockEnvironment env = new MockEnvironment(); ClientProperties clientProperties = new ClientProperties(); assertThat(clientProperties.isAutoDeregistration(env)).isFalse(); clientProperties.setAutoDeregistration(false); assertThat(clientProperties.isAutoDeregistration(env)).isFalse(); clientProperties.setAutoDeregistration(true); assertThat(clientProperties.isAutoDeregistration(env)).isTrue(); }
@Test public void should_default_autoDeregister_to_true() { MockEnvironment env = new MockEnvironment(); env.setProperty("VCAP_APPLICATION", ""); ClientProperties clientProperties = new ClientProperties(); assertThat(clientProperties.isAutoDeregistration(env)).isTrue(); clientProperties.setAutoDeregistration(false); assertThat(clientProperties.isAutoDeregistration(env)).isFalse(); clientProperties.setAutoDeregistration(true); assertThat(clientProperties.isAutoDeregistration(env)).isTrue(); }