public function setElectronicAddresses(Collection $electronicAddresses)
    {
        if ($this->primaryElectronicAddress !== null && !$this->electronicAddresses->contains($this->primaryElectronicAddress)) {
            $this->primaryElectronicAddress = null;
        }
        $this->electronicAddresses = $electronicAddresses;
    }