@Test
public void matches() throws MalformedObjectNameException {

    HistoryKey key = new HistoryKey("test:type=*","bla",null,null);
    assertTrue(key.isMBeanPattern());
    
    JmxReadRequest req2 = new JmxRequestBuilder(READ,"test:type=hello")
            .attribute("bla")
            .build();
    JmxReadRequest req3 = new JmxRequestBuilder(READ,"test:name=hello")
            .attribute("bla")
            .build();
    HistoryKey key2 = new HistoryKey(req2);
    assertFalse(key2.isMBeanPattern());
    HistoryKey key3 = new HistoryKey(req3);
    assertFalse(key3.isMBeanPattern());
    assertTrue(key.matches(key2));
    assertFalse(key.matches(key3));
}