protected function modifyAddresses(array $addresses)
{
$values = is_array($this->getLastValue()) ? $this->getLastValue() : [$this->getLastValue()];
if ($this->getOperationType() == self::TYPE_CREATE || $this->getBatch() && $this->getBatch()->isTypeAdd()) {
$values = array_merge($values, $addresses);
} elseif ($this->getBatch() && $this->getBatch()->isTypeReplace()) {
$values = $this->replaceAddressesOfType($values, $addresses);
} elseif ($this->getBatch() && $this->getBatch()->isTypeRemove()) {
$values = array_diff($values, $addresses);
}
$this->setLastValue($values);
}