Element e = XMLUtil.stringToElement(s);
MBeanConfigurationElement mbeanConfig = new MBeanConfigurationElement(e);
assertEquals(new ObjectName("somedomain:service=SomeService"), mbeanConfig.getObjectName());
assertEquals("org.example.SomeClass", mbeanConfig.getMBeanClassName());
assertTrue(mbeanConfig.attributeNames().isEmpty());
Set optionalAttributeNames = mbeanConfig.dependencyOptionalAttributeNames();
assertEquals(1, optionalAttributeNames.size());
assertTrue(optionalAttributeNames.contains("SomeName"));
assertEquals("somedomain:somekey=somevalue",