@Test
public void testMatches() throws ParseException
{

   assertTrue(PathElement.pathElement("{path}").matches("foo"));
   assertTrue(PathElement.pathElement("{path}bar").matches("foo-foobar"));
   assertTrue(PathElement.pathElement("{path: .*}").matches("foo/bar"));
   assertTrue(PathElement.pathElement("{path: .*}/bar").matches("foo/foo-bar/bar"));
   assertFalse(PathElement.pathElement("{path: .*}/bar").matches("foo/foo-bar/"));
   assertTrue(PathElement.pathElement("{alphapath: [a-zA-Z]{3}}/{numpath: [0-9]*}").matches("foo/123"));
   assertFalse(PathElement.pathElement("{alphapath: [a-zA-Z]{3}}/{numpath: [0-9]*}").matches("foobar/123"));
   assertFalse(PathElement.pathElement("{alphapath: [a-zA-Z]{3}}/{numpath: [0-9]*}").matches("foo/a123"));
   assertTrue(PathElement.pathElement("{weird: \\{foo\\}\\/\\{bar\\}}").matches("{foo}/{bar}"));
   assertFalse(PathElement.pathElement("{weird: \\{foo\\}\\/\\{bar\\}}").matches("foo/bar"));
   assertTrue(PathElement.pathElement("foo/{required}/{optional: .*}").matches("foo/bar/"));
   assertFalse(PathElement.pathElement("foo/{bar}/{required}").matches("foo/bar"));
}