@Test
public void testId() throws Exception {

    String idString = "system/xml/account";
    Id id = new Id(idString);
    Assert.assertEquals(id.getSystemName(), "xml");
    Assert.assertEquals(id.getObjectType(), "account");
    Assert.assertNull(id.getLocalId());
    idString = "system/xml/account/af352880-73e0-11e0-a1f0-0800200c9a66";
    id = new Id(idString);
    Assert.assertEquals(id.getSystemName(), "xml");
    Assert.assertEquals(id.getObjectType(), "account");
    Assert.assertEquals(id.getLocalId(), "af352880-73e0-11e0-a1f0-0800200c9a66");
    idString = "system/Active Directory/User type/<GUID=500ac9a4c732df45bde6e5dbc784de04>";
    id = new Id(idString);
    Assert.assertEquals(id.getSystemName(), "Active Directory");
    Assert.assertEquals(id.getObjectType(), "User type");
    Assert.assertEquals(id.getLocalId(), "<GUID=500ac9a4c732df45bde6e5dbc784de04>");
    idString = "system/Active+Directory/User+type/%3CGUID%3D500ac9a4c732df45bde6e5dbc784de04%3E";
    Assert.assertEquals(id.getQualifiedId().toString(), idString);
    id = new Id(idString);
    Assert.assertEquals(id.getSystemName(), "Active Directory");
    Assert.assertEquals(id.getObjectType(), "User type");
    Assert.assertEquals(id.getLocalId(), "<GUID=500ac9a4c732df45bde6e5dbc784de04>");
}