snapshotsForEntity.addObject(dbContext.snapshotForGlobalID(globalID));
synchronized (snapshotsForEntity) { Object o = dbContext.snapshotForGlobalID(globalID); if (o != null) { snapshotsForEntity.addObject(o); } }
        public NSDictionary snapshotsGroupedByEntity(NSArray objects, EOObjectStoreCoordinator osc) {            if (objects == null)  return NSDictionary.EmptyDictionary;            NSMutableDictionary result = new NSMutableDictionary();            Enumeration e = objects.objectEnumerator();            while (e.hasMoreElements()) {                EOKeyGlobalID globalID = (EOKeyGlobalID) e.nextElement();                String entityName = globalID.entityName();                EODatabaseContext dbContext = databaseContextForEntityNamed(entityName, osc);                NSMutableArray snapshotsForEntity = (NSMutableArray)result.objectForKey(entityName);                if (snapshotsForEntity == null) {                    snapshotsForEntity = new NSMutableArray();                    result.setObjectForKey(snapshotsForEntity, entityName);                }                snapshotsForEntity.addObject(dbContext.snapshotForGlobalID(globalID));            }            return result.immutableClone();        }