@Test
public void registerMBean() throws MalformedObjectNameException, NotCompliantMBeanException,
                                   InstanceAlreadyExistsException, MBeanRegistrationException, InstanceNotFoundException {

    MBeanServer jolokiaServer = JolokiaMBeanServerUtil.getJolokiaMBeanServer();
    Dummy test = new Dummy();
    ObjectName name = new ObjectName("jolokia.test:name=test");
    JolokiaMBeanServerUtil.registerMBean(test, name);
    assertTrue(jolokiaServer.isRegistered(name));
    JolokiaMBeanServerUtil.unregisterMBean(name);
    Assert.assertFalse(jolokiaServer.isRegistered(name));
}