@SuppressWarnings("StringSplitter")
    public static List<String> extractImportantUrlData(String text) throws MalformedURLException {
        final List<String> importantParts = new ArrayList<>();
        final URL url = new URL(text);
        final String[] domain = url.getHost().split("\\.");
        //add the domain except www and the tld.
        for (int i = 0; i < domain.length - 1; i++) {
            final String sub = domain[i];
            if (Arrays.binarySearch(IGNORE_LIST, sub.toLowerCase()) < 0) {
                importantParts.add(sub);
            }
        }
        final String document = url.getPath();
        final String[] pathParts = document.split("[\\\\//]");
        for (int i = 0; i < pathParts.length - 1; i++) {
            if (!pathParts[i].isEmpty()) {
                importantParts.add(pathParts[i]);
            }
        }
        if (pathParts.length > 0 && !pathParts[pathParts.length - 1].isEmpty()) {
            final String tmp = pathParts[pathParts.length - 1];
            final int pos = tmp.lastIndexOf('.');
            if (pos > 1) {
                importantParts.add(tmp.substring(0, pos));
            } else if (pos == 0 && tmp.length() > 1) {
                importantParts.add(tmp.substring(1));
            } else {
                importantParts.add(tmp);
            }
        }
        return importantParts;
    }
@Test
    public void testExtractImportantUrlData() throws Exception {
        String text = "http://github.com/jeremylong/DependencyCheck/.gitignore";
        List<String> expResult = Arrays.asList("jeremylong", "DependencyCheck", "gitignore");
        List<String> result = UrlStringUtils.extractImportantUrlData(text);
        assertEquals(expResult, result);
        
        text = "http://jeremylong.github.io/DependencyCheck/index.html";
        expResult = Arrays.asList("jeremylong", "DependencyCheck", "index");
        result = UrlStringUtils.extractImportantUrlData(text);
        assertEquals(expResult, result);
        
        text = "http://example.com/jeremylong/DependencyCheck/something";
        expResult = Arrays.asList("example", "jeremylong", "DependencyCheck", "something");
        result = UrlStringUtils.extractImportantUrlData(text);
        assertEquals(expResult, result);
    }