if (entity.subEntities().size() > 0) { for (Iterator it = entity.subEntities().iterator(); it.hasNext();) { EOEntity entity1 = (EOEntity) it.next(); entityNames.addObjectsFromArray(externalNamesForEntity(entity1, includeParentEntities));
if (entity.subEntities().count() > 0) { for (Enumeration it = entity.subEntities().objectEnumerator(); it.hasMoreElements();) { EOEntity entity1 = (EOEntity) it.nextElement(); NSArray names = externalNamesForEntity(entity1, includeParentEntities); entityNames.addObjectsFromArray(names);
    public static NSArray externalNamesForEntity(EOEntity entity, boolean includeParentEntities) {        if (includeParentEntities) {             entity = rootEntityForEntity(entity);        }        NSMutableArray entityNames = new NSMutableArray();        if (entity.subEntities().size() > 0) {            for (Iterator it = entity.subEntities().iterator(); it.hasNext();) {                EOEntity entity1 = (EOEntity) it.next();                entityNames.addObjectsFromArray(externalNamesForEntity(entity1, includeParentEntities));            }        }        entityNames.addObject(entity.name());        return ERXArrayUtilities.arrayWithoutDuplicates(entityNames);    }