UriPatten implements Comparable<UriPatten> { public boolean matches(String uri) { return pattern.matcher(uri).matches(); } UriPatten(String uriPattern); boolean matches(String uri); Optional<Map<String, String>> match(String uri); @Override int hashCode(); @Override int compareTo(UriPatten otherUriPattern); @Override boolean equals(Object obj); @Override String toString();  }
@Test(dataProvider = "matchingUriPatterns") public void testMatching(String uriPattern, String uri) { Assert.assertTrue(new UriPatten(uriPattern).matches(uri)); }
@Test(dataProvider = "unmatchingUriPatterns") public void testUnmatching(String uriPattern, String uri) { Assert.assertFalse(new UriPatten(uriPattern).matches(uri)); }