public URLNormalizer addDomainTrailingSlash() {
        String urlRoot = HttpURL.getRoot(url);
        String path = toURL().getPath();
        if (StringUtils.isNotBlank(path)) {
            // there is a path so do nothing
            return this;
        }
        String urlRootAndPath = urlRoot + "/";
        url = StringUtils.replaceOnce(url, urlRoot, urlRootAndPath);
        return this;
    }
@Test
    public void testAddDomainTrailingSlash() {
        s = "http://www.example.com";
        t = "http://www.example.com/";
        assertEquals(t, n(s).addDomainTrailingSlash().toString());

        s = "http://www.example.com/";
        t = "http://www.example.com/";
        assertEquals(t, n(s).addDomainTrailingSlash().toString());

        s = "http://www.example.com/blah";
        t = "http://www.example.com/blah";
        assertEquals(t, n(s).addDomainTrailingSlash().toString());

        s = "http://www.example.com/blah/path";
        t = "http://www.example.com/blah/path";
        assertEquals(t, n(s).addDomainTrailingSlash().toString());

        s = "http://www.example.com?param1=value1&param2=value2";
        t = "http://www.example.com/?param1=value1&param2=value2";
        assertEquals(t, n(s).addDomainTrailingSlash().toString());

        s = "http://www.example.com/?param1=value1&param2=value2";
        t = "http://www.example.com/?param1=value1&param2=value2";
        assertEquals(t, n(s).addDomainTrailingSlash().toString());

        s = "http://www.example.com#hash";
        t = "http://www.example.com/#hash";
        assertEquals(t, n(s).addDomainTrailingSlash().toString());

        s = "http://www.example.com/#hash";
        t = "http://www.example.com/#hash";
        assertEquals(t, n(s).addDomainTrailingSlash().toString());
    }