Url { public static String extractId(String url) throws MalformedURLException { return extractId(new URL(url)); } private  Url(); static URL parse(String uri); static URL parse(URI uri); static String extractId(String url); static String extractId(URL url);  }
@Test public void extractId() throws MalformedURLException { String id1 = Url.extractId("http: String id2 = Url.extractId("http: String id3 = Url.extractId("https: assertThat(id1, is(id2)); assertThat(id1, is(not(id3))); assertThat(id2, is(not(id3))); }