{
RoleList copy = (RoleList) roles.clone();
Iterator iterator = resolved.iterator();
while (iterator.hasNext())
{
Role role = (Role) iterator.next();
String roleName = role.getRoleName();
RoleInfo info = (RoleInfo) infos.get(roleName);
if (info == null)
fail("unknown role " + roleName);
if (info.isReadable() == false)
fail("role should not be readable " + roleName);
Role original = removeRole(copy, roleName);
compareListOfObjectNames(original.getRoleValue(), role.getRoleValue());
}
iterator = copy.iterator();
while (iterator.hasNext())
{
Role role = (Role) iterator.next();
String roleName = role.getRoleName();
RoleInfo info = (RoleInfo) infos.get(roleName);
if (info.isReadable() == true)
fail("missing role " + roleName);
}
}