### Question:
SuffixPrefixExpressions { public Set<String> makeExpressions(String url) { UrlSplitter.UrlParts parts = urlSplitter.split(url); if (parts == null) { LOGGER.info("URL cannot be split into parts: {}", url); return Collections.emptySet(); } Set<String> suffixExprSet = extractSuffixExpressions(parts.getHost()); Set<String> prefixExprSet = extractPrefixExpressions(parts); Set<String> result = new HashSet<>(); for (String hostSuffix : suffixExprSet) { for (String pathPrefix : prefixExprSet) { result.add(hostSuffix + pathPrefix); } } return result; }  Set<String> makeExpressions(String url);  }### Answer:
@Test public void testMakeExpressions1() { Set<String> set = expressions.makeExpressions("http: Assert.assertEquals(8, set.size()); Assert.assertTrue(set.contains("a.b.c/1/2.html?param=1")); Assert.assertTrue(set.contains("a.b.c/1/2.html")); Assert.assertTrue(set.contains("a.b.c/")); Assert.assertTrue(set.contains("a.b.c/1/")); Assert.assertTrue(set.contains("b.c/1/2.html?param=1")); Assert.assertTrue(set.contains("b.c/1/2.html")); Assert.assertTrue(set.contains("b.c/")); Assert.assertTrue(set.contains("b.c/1/")); }
@Test public void testMakeExpressions2() { Set<String> set = expressions.makeExpressions("http: Assert.assertEquals(10, set.size()); Assert.assertTrue(set.contains("a.b.c.d.e.f.g/1.html")); Assert.assertTrue(set.contains("a.b.c.d.e.f.g/")); Assert.assertTrue(set.contains("c.d.e.f.g/1.html")); Assert.assertTrue(set.contains("c.d.e.f.g/")); Assert.assertTrue(set.contains("d.e.f.g/1.html")); Assert.assertTrue(set.contains("d.e.f.g/")); Assert.assertTrue(set.contains("e.f.g/1.html")); Assert.assertTrue(set.contains("e.f.g/")); Assert.assertTrue(set.contains("f.g/1.html")); Assert.assertTrue(set.contains("f.g/")); }
@Test public void testMakeExpressions3() { Set<String> set = expressions.makeExpressions("http: Assert.assertEquals(2, set.size()); Assert.assertTrue(set.contains("1.2.3.4/1/")); Assert.assertTrue(set.contains("1.2.3.4/")); }