@Test
public void testWildcardQueriesMatchMultipleTags1() {

	SchemaService schemaServiceMock = mock(SchemaService.class);
    MetricSchemaRecordQuery queryForTag1 = new MetricSchemaRecordQueryBuilder().scope("scope0")
													     		   .metric("metric0")
													     		   .tagKey("source")
													     		   .tagValue("unittest0")
													     		   .limit(500)
													     		   .build();
    MetricSchemaRecordQuery queryForTag2 = new MetricSchemaRecordQueryBuilder().scope("scope0")
													     		   .metric("metric0")
													     		   .tagKey("device")
													     		   .tagValue("device[1]")
													     		   .limit(500)
													     		   .build();
      when(schemaServiceMock.get(queryForTag1)).thenReturn(Arrays.asList(
										       new MetricSchemaRecord(null, "scope0", "metric0", "source", "unittest0"),
										       new MetricSchemaRecord(null, "scope1", "metric0", "source", "unittest0")));
      when(schemaServiceMock.get(queryForTag2)).thenReturn(new ArrayList<>());
    DefaultDiscoveryService discoveryService = new DefaultDiscoveryService(schemaServiceMock, system.getConfiguration(), monitorService);
    Map<String, String> tags = new HashMap<String, String>();
    tags.put("source", "unittest0");
    tags.put("device", "device[1]");
    MetricQuery query = new MetricQuery("scope?", "metric0", tags, 1L, 2L);
    List<MetricQuery> matchedQueries = discoveryService.getMatchingQueries(query);
    assertTrue(matchedQueries.isEmpty());
}