public function restrictTo(string $type)
    {
        if (count($this) > 0) {
            throw new CollectionException('Type restriction could not be applied to a non empty collection');
        }

        $this->type = $type;

        return $this;
    }