### Question:
FixHttpLinks implements NodeListProcessor { public String repairUrl(String url) { if (url == null || url.contains("\\")) return url; if (!scheme.matcher(url).find()) { String url2 = missingslash.matcher(url).replaceFirst("$1: if (!scheme.matcher(url2).find()) { url2 = "http: } if (validUrl(url2)) { return url2; } } return url; } FixHttpLinks(); NodeList process(NodeList nodes); String repairUrl(String url);  }### Answer:
@Test public void TestIncompleteScheme() { assertEquals(new FixHttpLinks().repairUrl("http:/test.com"), "http: assertEquals(new FixHttpLinks().repairUrl("https:/domain.is"), "https: }
@Test public void TestMissingScheme() { assertEquals(new FixHttpLinks().repairUrl("test.com"), "http: assertEquals(new FixHttpLinks().repairUrl("www.domain.is"), "http: }
@Test public void TestPreserve() { assertEquals(new FixHttpLinks().repairUrl("C:\\file.txt"), "C:\\file.txt"); assertEquals(new FixHttpLinks().repairUrl("mailto:n@domain.com"), "mailto:n@domain.com"); }