### Question:
URLPatternMatcher { public boolean match(String requestedURL, Collection<String> patterns, boolean wildcard) throws MalformedURLException { boolean result = false; String patternLower; for (String pattern : patterns) { patternLower = pattern.toLowerCase(); requestedURL = resourceName.canonicalize(requestedURL); if (patternLower.startsWith("http")) { pattern = resourceName.canonicalize(pattern); } if (DEBUG.messageEnabled()) { DEBUG.message("URLPatternMatcher.match(" + requestedURL + "): matching by pattern: " + pattern); } ResourceMatch res = resourceName.compare(requestedURL, pattern, wildcard); if (res == ResourceMatch.WILDCARD_MATCH || res == ResourceMatch.EXACT_MATCH) { if (DEBUG.messageEnabled()) { DEBUG.message("URLPatternMatcher.match(" + requestedURL + "): matched by pattern: " + pattern + " result = " + res); } result = true; break; } } return result; } URLPatternMatcher(); boolean match(String requestedURL, Collection<String> patterns, boolean wildcard);  }### Answer:
@Test(dataProvider = "testdata") private void performTestAndAssert(String pattern, String url, boolean result) throws MalformedURLException { boolean answer = urlPatternMatcher.match(url, Collections.singleton(pattern), true); assertEquals(result, answer); }