src/Collection/Collection.php
public function add(ItemInterface $item)
    {
        if ($this->has($item->getId())) {
            throw new \DomainException(sprintf(
                'Failed adding item "%s": an item with that id has already been added.',
                $item->getId()
            ));
        }
        $this->items[$item->getId()] = $item;

        return $this;
    }
public function add(ItemInterface $item)
    {
        if ($this->has($item->getId())) {
            throw new \DomainException(sprintf(
                'Failed adding item "%s": an item with that id has already been added.',
                $item->getId()
            ));
        }
        $this->items[$item->getId()] = $item;

        return $this;
    }
{@inheritdoc}