if (getIdInternal() != null && domainObject.getIdInternal() != null
if (domainObject instanceof Proxy) { domainObject = (IDomainObject) ProxyHelper.getRealObject(domainObject); }  if (this.getClass() == domainObject.getClass() && getIdInternal() != null
    public boolean equals(Object obj) {        if (obj != null && obj instanceof IDomainObject) {            IDomainObject domainObject = (IDomainObject) obj;            if (getIdInternal() != null && domainObject.getIdInternal() != null                    && getIdInternal().equals(domainObject.getIdInternal())) {                Collection thisInterfaces = getInterfaces(getClass());                Collection objInterfaces = getInterfaces(domainObject.getClass());                thisInterfaces = CollectionUtils.select(thisInterfaces, new IS_NOT_IDOMAIN_PREDICATE());                objInterfaces = CollectionUtils.select(objInterfaces, new IS_NOT_IDOMAIN_PREDICATE());                if (!CollectionUtils.intersection(thisInterfaces, objInterfaces).isEmpty()) {                    return true;                }            }        }        return false;    }