if (firstEO != null && secondEO != null) {
if ( firstEO == secondEO ) { result = true; } else if (firstEO != null && secondEO != null) {
    public static boolean eoEquals(EOEnterpriseObject firstEO, EOEnterpriseObject secondEO) {        boolean result;                if (firstEO != null && secondEO != null) {            final EOEditingContext firstContext = firstEO.editingContext();            final EOEditingContext secondContext = secondEO.editingContext();                        if (firstContext != null && secondContext != null) {                final EOGlobalID firstGID = firstContext.globalIDForObject(firstEO);                final EOGlobalID secondGID = secondContext.globalIDForObject(secondEO);                                result = firstGID.equals(secondGID);            }            else if (firstContext == null && secondContext == null) {                result = firstEO.equals(secondEO);            }            else {                result = false;            }        }        else if (firstEO != null || secondEO != null) {            result = false;        }        else {  // both are null            result = true;        }                return result;            }