public function parent() {
        $path = $this->path;

        array_pop($path);

        if (empty($path)) {
            throw new \RuntimeException("Can't get parent of root path");
        }

        return new static($path);
    }