src/Collection/Collection.php
public function setId($id = '')
    {
        if (empty($id)) {
            $this->id = spl_object_hash($this);
        } else {
            $this->id = $id;
        }

        return $this;
    }
public function setId($id = '')
    {
        if (empty($id)) {
            $this->id = spl_object_hash($this);
        } else {
            $this->id = $id;
        }

        return $this;
    }
If parameter is empty uses the object hash
{@inheritdoc}