UrlMarker { public UrlMarker() { } UrlMarker(); Url createUrl(); void setOriginalUrl(String originalUrl); String getOriginalUrl(); void setIndex(UrlPart urlPart, int index); int indexOf(UrlPart urlPart); void unsetIndex(UrlPart urlPart);  }
@Test(dataProvider = "getUrlMarkers") public void testUrlMarker(String testString, String scheme, String username, String password, String host, int port, String path, String query, String fragment, int[] indices) { UrlMarker urlMarker = new UrlMarker(); urlMarker.setOriginalUrl(testString); urlMarker.setIndices(indices); Url url = urlMarker.createUrl(); Assert.assertEquals(url.getHost(), host, "host, " + testString); Assert.assertEquals(url.getPath(), path, "path, " + testString); Assert.assertEquals(url.getScheme(), scheme, "scheme, " + testString); Assert.assertEquals(url.getUsername(), username, "username, " + testString); Assert.assertEquals(url.getPassword(), password, "password, " + testString); Assert.assertEquals(url.getPort(), port, "port, " + testString); Assert.assertEquals(url.getQuery(), query, "query, " + testString); Assert.assertEquals(url.getFragment(), fragment, "fragment, " + testString); }