Common/Util/AddressUtil.php
static public function equals(AddressInterface $source, AddressInterface $target)
    {
        if (!($source->getCompany() === $target->getCompany()
            && $source->getGender() === $target->getGender()
            && $source->getFirstName() === $target->getFirstName()
            && $source->getLastName() === $target->getLastName()
            && $source->getStreet() === $target->getStreet()
            && $source->getComplement() === $target->getComplement()
            && $source->getSupplement() === $target->getSupplement()
            && $source->getExtra() === $target->getExtra()
            && $source->getCity() === $target->getCity()
            && $source->getPostalCode() === $target->getPostalCode()
            && $source->getDigicode1() === $target->getDigicode1()
            && $source->getDigicode2() === $target->getDigicode2()
            && $source->getIntercom() === $target->getIntercom())) {
            return false;
        }

        $sourceCountryId = $source->getCountry() ? $source->getCountry()->getId() : null;
        $targetCountryId = $target->getCountry() ? $target->getCountry()->getId() : null;
        if ($sourceCountryId != $targetCountryId) {
            return false;
        }

        $sourceStateId = $source->getState() ? $source->getState()->getId() : null;
        $targetStateId = $target->getState() ? $target->getState()->getId() : null;
        if ($sourceStateId != $targetStateId) {
            return false;
        }
        
        $sourcePhone = (string) $source->getPhone();
        $targetPhone = (string) $target->getPhone();
        if ($sourcePhone !== $targetPhone) {
            return false;
        }
        
        $sourceMobile = (string) $source->getMobile();
        $targetMobile = (string) $target->getMobile();
        if ($sourceMobile !== $targetMobile) {
            return false;
        }

        return true;
    }
static public function equals(AddressInterface $source, AddressInterface $target)
    {
        if (!($source->getCompany() === $target->getCompany()
            && $source->getGender() === $target->getGender()
            && $source->getFirstName() === $target->getFirstName()
            && $source->getLastName() === $target->getLastName()
            && $source->getStreet() === $target->getStreet()
            && $source->getComplement() === $target->getComplement()
            && $source->getSupplement() === $target->getSupplement()
            && $source->getExtra() === $target->getExtra()
            && $source->getCity() === $target->getCity()
            && $source->getPostalCode() === $target->getPostalCode()
            && $source->getDigicode1() === $target->getDigicode1()
            && $source->getDigicode2() === $target->getDigicode2()
            && $source->getIntercom() === $target->getIntercom())) {
            return false;
        }

        $sourceCountryId = $source->getCountry() ? $source->getCountry()->getId() : null;
        $targetCountryId = $target->getCountry() ? $target->getCountry()->getId() : null;
        if ($sourceCountryId != $targetCountryId) {
            return false;
        }

        $sourceStateId = $source->getState() ? $source->getState()->getId() : null;
        $targetStateId = $target->getState() ? $target->getState()->getId() : null;
        if ($sourceStateId != $targetStateId) {
            return false;
        }
        
        $sourcePhone = (string) $source->getPhone();
        $targetPhone = (string) $target->getPhone();
        if ($sourcePhone !== $targetPhone) {
            return false;
        }
        
        $sourceMobile = (string) $source->getMobile();
        $targetMobile = (string) $target->getMobile();
        if ($sourceMobile !== $targetMobile) {
            return false;
        }

        return true;
    }
Returns whether this address equals the given address or not.

@param AddressInterface $source
@param AddressInterface $target

@return boolean