### Question:
ExporterConfig { public Integer getRestPort() { return restPort; } private  ExporterConfig(Map<String, Object> yaml); static ExporterConfig createEmptyConfig(); static ExporterConfig loadConfig(InputStream inputStream); Map<String, Object> scrapeMetrics(MBeanSelector selector, JsonObject response); MBeanSelector[] getEffectiveQueries(); MBeanSelector[] getQueries(); static ExporterConfig loadConfig(Map<String, Object> yamlConfig); QuerySyncConfiguration getQuerySyncConfiguration(); Integer getRestPort(); void append(ExporterConfig config2); void replace(ExporterConfig config2); @Override String toString();  }### Answer:
@Test public void afterReplace_configHasChangedRestPort() { assertThat(getReplacedConfiguration(SERVLET_CONFIG, REST_PORT_CONFIG).getRestPort(), equalTo(1234)); assertThat(getReplacedConfiguration(REST_PORT_CONFIG, SERVLET_CONFIG).getRestPort(), nullValue()); }
@Test public void afterAppend_configHasOriginalRestPort() { assertThat(getAppendedConfiguration(SERVLET_CONFIG, REST_PORT_CONFIG).getRestPort(), nullValue()); assertThat(getAppendedConfiguration(REST_PORT_CONFIG, SERVLET_CONFIG).getRestPort(), equalTo(1234)); }