{
try
{
MBeanServer server = MBeanServerFactory.newMBeanServer();
ObjectName objectName = new ObjectName("test:key=value");
PackageProtectedMBean mbean = PackageProtectedMBeanFactory.createMBean("TestMBean");
server.registerMBean(mbean, objectName);
String name = (String)server.getAttribute(objectName, "Name");
assertEquals("TestMBean", name);