public static boolean isValidRootUrl(String url) {
        UrlValidator validator = new CustomUrlValidator();
        return validator.isValid(url);
    }
@Test
    @Issue("JENKINS-51064")
    public void withCustomDomain() {
        assertTrue(UrlHelper.isValidRootUrl("http://my-server:8080/jenkins"));
        assertTrue(UrlHelper.isValidRootUrl("http://jenkins.internal/"));
        assertTrue(UrlHelper.isValidRootUrl("http://jenkins.otherDomain/"));
        assertTrue(UrlHelper.isValidRootUrl("http://my-server.domain:8080/jenkins"));
        assertTrue(UrlHelper.isValidRootUrl("http://my-ser_ver.do_m-ain:8080/jenkins"));
        assertTrue(UrlHelper.isValidRootUrl("http://my-ser_ver.do_m-ain:8080/jenkins"));

        // forbidden to start or end domain with - or .
        assertFalse(UrlHelper.isValidRootUrl("http://-jenkins.com"));
        assertFalse(UrlHelper.isValidRootUrl("http://jenkins.com-"));
        assertFalse(UrlHelper.isValidRootUrl("http://.jenkins.com"));

        // allowed to have multiple dots in chain
        assertTrue(UrlHelper.isValidRootUrl("http://jen..kins.com"));
    }