@Test
public void testFindWildcardMatch() throws Exception {

    JMXLocationResolver resolver = new JMXLocationResolver();
    String match = resolver.findWildcardMatch(new JMXNodeLocation("domain:one=1,two=*"),
            new JMXNodeLocation("domain:one=1,two=222"));
    Assert.assertEquals("222", match);
    try {
        match = resolver.findWildcardMatch(new JMXNodeLocation("domain:one=1"),
                new JMXNodeLocation("domain:one=111"));
        Assert.fail("Should not have matched: " + match);
    } catch (ProtocolException ok) {
    }
    try {
        match = resolver.findWildcardMatch(null, new JMXNodeLocation("domain:one=1"));
        Assert.fail("Should not have matched: " + match);
    } catch (ProtocolException ok) {
    }
}