String entityName = (String) e.nextElement();
NSArray gidsForEntity = (NSArray) gidsByEntity.objectForKey(entityName);
for (Enumeration gids = gidsForEntity.objectEnumerator(); gids.hasMoreElements();) {
EOKeyGlobalID keyGID = (EOKeyGlobalID) gids.nextElement();
if(keyGID.keyCount() == 1) {
result.addObject(keyGID.keyValues()[0]);
} else {
throw new IllegalArgumentException("GID has more than one key: " + keyGID);
}
}