@Test
public void objectNameSplitting() throws MalformedObjectNameException {

    assertThat(RBACDecorator.nameSegments(new ObjectName("a.b:type=a,name=b")).toArray(new String[3]),
        equalTo(new String[]{"a.b", "a", "b"}));
    assertThat(RBACDecorator.nameSegments(new ObjectName("a.b:name=b,type=a")).toArray(new String[3]),
        equalTo(new String[]{"a.b", "a", "b"}));
}