### Question:
ExporterConfig { public MBeanSelector[] getEffectiveQueries() { if (queries == null) return NO_QUERIES; return withPossibleDomainNameQuery(Arrays.stream(queries)).toArray(MBeanSelector[]::new); } 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 whenDomainQualifierNotSpecified_dontModifyQueries() { ExporterConfig config = loadFromString(SERVLET_CONFIG); MBeanSelector[] queries = config.getEffectiveQueries(); assertThat(queries, arrayWithSize(1)); assertThat(queries[0].getUrl(Protocol.HTTP, "myhost", 1234), equalTo(String.format(QueryType.RUNTIME_URL_PATTERN, "http", "myhost", 1234))); }
@Test public void whenSpecified_prependConfigurationQuery() { ExporterConfig config = loadFromString(DOMAIN_QUALIFIER_CONFIG); MBeanSelector[] queries = config.getEffectiveQueries(); assertThat(queries, arrayWithSize(2)); assertThat(queries[0], sameInstance(MBeanSelector.DOMAIN_NAME_SELECTOR)); assertThat(queries[1].getUrl(Protocol.HTTP, "myhost", 1234), equalTo(String.format(QueryType.RUNTIME_URL_PATTERN, "http", "myhost", 1234))); }