protected UrlData extractUrlData(String nvdDataFeedUrl) {
        String url;
        String pattern = null;
        if (nvdDataFeedUrl.endsWith(".json.gz")) {
            final int lio = nvdDataFeedUrl.lastIndexOf("/");
            pattern = nvdDataFeedUrl.substring(lio + 1);
            url = nvdDataFeedUrl.substring(0, lio);
        } else {
            url = nvdDataFeedUrl;
        }
        if (!url.endsWith("/")) {
            url += "/";
        }
        return new UrlData(url, pattern);
    }
@Test
    public void testExtractUrlData() {
        String nvdDataFeedUrl = "https://internal.server/nist/nvdcve-{0}.json.gz";
        NvdApiDataSource instance = new NvdApiDataSource();
        String expectedUrl = "https://internal.server/nist/";
        String expectedPattern = "nvdcve-{0}.json.gz";
        NvdApiDataSource.UrlData result = instance.extractUrlData(nvdDataFeedUrl);

        nvdDataFeedUrl = "https://internal.server/nist/";
        expectedUrl = "https://internal.server/nist/";
        result = instance.extractUrlData(nvdDataFeedUrl);

        assertEquals(expectedUrl, result.getUrl());
        assertNull(result.getPattern());
        
        nvdDataFeedUrl = "https://internal.server/nist";
        expectedUrl = "https://internal.server/nist/";
        result = instance.extractUrlData(nvdDataFeedUrl);

        assertEquals(expectedUrl, result.getUrl());
        assertNull(result.getPattern());
    }