### Question:
UrlUtils { public static String getDomain(String url) { String domain = removeProtocol(url); int i = StringUtils.indexOf(domain, "/", 1); if (i > 0) { domain = StringUtils.substring(domain, 0, i); } return removePort(domain); }  static String canonicalizeUrl(String url, String refer); static String encodeIllegalCharacterInUrl(String url); static String fixIllegalCharacterInUrl(String url); static String getHost(String url); static String removeProtocol(String url); static String getDomain(String url); static String removePort(String domain); static String getPath(String url); static List<Request> convertToRequests(Collection<String> urls); static List<String> convertToUrls(Collection<Request> requests); static String getCharset(String contentType);  }### Answer:
@Test public void test_get_domain() throws Exception { String url = "http: Assert.assertEquals("www.lblogg.cn", UrlUtils.getDomain(url)); url = "www.lblogg.cn/single/124"; Assert.assertEquals("www.lblogg.cn", UrlUtils.getDomain(url)); url = "http: Assert.assertEquals("www.lblogg.cn", UrlUtils.getDomain(url)); }