@Test
public void simpleFound() throws MalformedObjectNameException, InstanceNotFoundException, ReflectionException, AttributeNotFoundException, MBeanException, IntrospectionException {

    expect(server.queryNames(new ObjectName("jboss.as:management-root=server"),null)).andReturn(Collections.EMPTY_SET);
    ObjectName oName = prepareQuery("jboss.system:type=Server");
    expect(server.isRegistered(oName)).andStubReturn(true);
    expect(server.getAttribute(oName, "Version")).andReturn("5.1.0");
    replay(server);
    ServerHandle handle = detector.detect(servers);
    assertEquals(handle.getVersion(),"5.1.0");
    assertEquals(handle.getVendor(),"RedHat");
    assertEquals(handle.getProduct(),"jboss");
    // Verify workaround
    reset(server);
    ObjectName memoryBean = new ObjectName("java.lang:type=Memory");
    expect(server.isRegistered(memoryBean)).andStubReturn(true);
    replay(server);
    handle.preDispatch(servers, new JmxRequestBuilder(RequestType.READ, memoryBean).attribute("HeapMemoryUsage").<JmxRequest>build());
    verify(server);
}