private function getCategoryUrl($category)
    {
        $documentSource = $category->getDocumentSource();

        if ($documentSource && isset($documentSource['url_path'])) {
            $urlPath = is_array($documentSource['url_path']) ? current($documentSource['url_path']) : $documentSource['url_path'];

            $url = trim($this->urlBuilder->getUrl($urlPath), '/') . $this->categoryUrlSuffix;

            return $url;
        }

        return $category->getUrl();
    }