	@Test
	public void testUnregisterMBean() throws Exception {

		logger.info("Default jmx domain: {}", JMXFactory.getDefaultDomain());
		JMXAgent agent = new JMXAgent();
		agent.init();
		MBeanServer mbs = JMXFactory.getMBeanServer();
		//create a new mbean for this instance
		ObjectName oName = JMXFactory.createMBean(
				"org.red5.server.net.rtmp.RTMPMinaConnection",
				"connectionType=persistent,host=10.0.0.1,port=1935,clientId=1");
		assertNotNull(oName);

		ObjectName oName2 = new ObjectName(
				"org.red5.server:type=RTMPMinaConnection,connectionType=persistent,host=10.0.0.2,port=1935,clientId=2");

		logger.info("Register check 1: {}", mbs.isRegistered(oName));
		assertTrue(JMXAgent.unregisterMBean(oName));
		logger.info("Register check 2: {}", mbs.isRegistered(oName));
		assertFalse(JMXAgent.unregisterMBean(oName));
		logger.info("Register check 3: {}", mbs.isRegistered(oName2));
		assertFalse(JMXAgent.unregisterMBean(oName2));
	}