### Question:
ExporterConfig { @Override public String toString() { StringBuilder sb = new StringBuilder(); if (querySyncConfiguration != null) sb.append(querySyncConfiguration); if (metricsNameSnakeCase) sb.append("metricsNameSnakeCase: true\n"); if (useDomainQualifier) sb.append(DOMAIN_QUALIFIER + ": true\n"); if (restPort != null) sb.append(REST_PORT + ": ").append(restPort).append("\n"); sb.append("queries:\n"); for (MBeanSelector query : getQueries()) sb.append(formatQuery(query)); return sb.toString(); } 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 whenYamlContainsMergeableQueries_MergeThem() { ExporterConfig config = loadFromString(MERGEABLE_CONFIG); assertThat(config.toString(), equalTo(MERGED_CONFIG)); }
@Test public void whenConfigHasSingleValue_displayAsScalar() { ExporterConfig exporterConfig = loadFromString(CONFIG_WITH_SINGLE_VALUE); assertThat(exporterConfig.toString(), equalTo(CONFIG_WITH_SINGLE_VALUE)); }
@Test public void afterLoad_convertToString() { ExporterConfig config = loadFromString(SNAKE_CASE_CONFIG); assertThat(config.toString(), equalToIgnoringWhiteSpace(SNAKE_CASE_CONFIG)); }
@Test public void includeTopLevelFieldsInString() { ExporterConfig config = loadFromString(CONFIG_WITH_TOP_LEVEL_FIELDS); assertThat(config.toString(), equalToIgnoringWhiteSpace(CONFIG_WITH_TOP_LEVEL_FIELDS)); }
@Test public void includeSnakeCaseTrueSettingInToString() { ExporterConfig config = loadFromString(SNAKE_CASE_CONFIG); assertThat(config.toString(), equalToIgnoringWhiteSpace(SNAKE_CASE_CONFIG)); }
@Test public void includeRestPortSettingInToString() { ExporterConfig config = loadFromString(REST_PORT_CONFIG); assertThat(config.toString(), equalToIgnoringWhiteSpace(REST_PORT_CONFIG)); }