MBeanServer server = MBeanServerFactory.createMBeanServer();
ObjectName oname = new ObjectName("test:test=test");
ObjectName oname2 = new ObjectName("test:test=test2");
RequiredModelMBean rmm = new RequiredModelMBean();
Resource resource = new Resource();
rmm.setManagedResource(resource, "ObjectReference");
rmm.setModelMBeanInfo(resource.getMBeanInfo());
server.registerMBean(rmm, oname);
server.registerMBean(rmm, oname2);
ProxyContext ctx = (ProxyContext)MBeanProxy.get(