### Question:
UrlPatternParser { public boolean matches(final String url) { return Pattern.compile(urlPattern).matcher(url).matches(); } UrlPatternParser(final String pattern); boolean matches(final String url); Map<String, String> getMappedParameters(final String url); String getMappedUrl(final Object... params); void setUrlPattern(final String urlPattern); int getParameterCount();  }### Answer:
@Test public void testMatches() { assertTrue(parser.matches("/project/starfish1/starfish2/story1")); assertFalse(parser.matches("project/starfish1/starfish2/story1")); assertFalse(parser.matches("/project/starfish1/starfish2/story1/")); assertFalse(parser.matches("project/starfish1/starfish2/story1/test")); assertFalse(parser.matches("project/starfish2/story1")); assertFalse(parser.matches("project/starfish1/starfish2")); assertFalse(parser.matches("project/starfish1/starfish2/")); }