public function slice($offset, $length = null): CollectionInterface
    {
        if ($length < 0) {
            throw new InvalidArgumentException('Negative slice lengths are not supported');
        }

        $result = $this;
        if ($offset < 0) {
            $result = $this->take($offset);
        } elseif ($offset > 0) {
            $result = $this->offset($offset);
        }

        if ($length !== null) {
            $result = $result->take($length);
        }

        return $result;
    }