XUrl { public static String host(String url) { try { return domainChecked(url); } catch (URISyntaxException e) { log.info("Malformed url: {}", url); return null; } }  static String host(String url); static int port(String url); static String domainChecked(String url); static String path(String url); static String stripUrlParameters(String url); static String stripUrlParameters(URL url); static String rawQueryParameters(String url); static String addProtocol(String url); static Map<String, List<String>> decodeQueryString(String url); static InetSocketAddress inetSocket(String url);  }
@Test void getHost() { assertEquals("api.nordstrom.com", XUrl.host(url1)); }
@Test void getHost_withPort() { assertEquals("api.nordstrom.com", XUrl.host(url2)); }