}
@Test
public void validateQueryWithAttributes() throws MalformedObjectNameException {
ObjectName objectName = new ObjectName("java.lang:type=MemoryPool,name=PS Eden Space");
Query query = queriesByResultName.get("test-attributes");
assertThat(query.getObjectName(), is(objectName));
assertThat(query.getResultAlias(), is("test-attributes"));
assertThat(query.getQueryAttributes().size(), is(2));
Map<String, QueryAttribute> queryAttributes = TestUtils.indexQueryAttributesByAliasOrName(query.getQueryAttributes());
{
QueryAttribute queryAttribute = queryAttributes.get("CollectionUsageThresholdExceeded");
assertThat(queryAttribute.getName(), is("CollectionUsageThresholdExceeded"));
assertThat(queryAttribute.getResultAlias(), nullValue());