HashMap<String,Object> map = new HashMap<String,Object>();
map.put(SecurityConstants.PRINCIPAL_IDENTIFIER, principal);
map.put(SecurityConstants.DEPLOYMENT_PRINCIPAL_ROLES_MAP, rolesMap);
RoleGroup grp = new SimpleRoleGroup(SecurityConstants.ROLES_IDENTIFIER);
grp.addRole(new SimpleRole("oldRole"));
MappingContext<RoleGroup> mc = sc.getMappingManager().getMappingContext(RoleGroup.class);
assertNotNull("Mapping Context is not null", mc);
mc.performMapping(map, grp);
grp = (RoleGroup) mc.getMappingResult().getMappedObject();
assertFalse("oldRole does not exist", grp.containsRole(new SimpleRole("oldRole")));
assertTrue("t1 exists?",grp.containsRole(new SimpleRole("t1")));
assertTrue("t2 exists?",grp.containsRole(new SimpleRole("t2")));
}