@Test
public void testResolve() throws ParseException
{

   assertEquals("foo", PathElement.pathElement("{path}").resolve("path", "/foo"));
   assertEquals("foo", PathElement.pathElement("{path}").resolve("path", "foo"));
   assertEquals("foo-foo", PathElement.pathElement("{path}bar").resolve("path", "foo-foobar"));
   assertEquals("foo/bar", PathElement.pathElement("{path: .*}").resolve("path", "/foo/bar"));
   assertEquals("foo/foo-bar", PathElement.pathElement("{path: .*}/bar").resolve("path", "foo/foo-bar/bar"));
   assertEquals("foo", PathElement.pathElement("{alphapath: [a-zA-Z]{3}}/{numpath: [0-9]*}").resolve("alphapath", "foo/123"));
   assertEquals("123", PathElement.pathElement("{alphapath: [a-zA-Z]{3}}/{numpath: [0-9]*}").resolve("numpath", "foo/123"));
   assertEquals("{foo}/{bar}", PathElement.pathElement("something/{weird: \\{foo\\}\\/\\{bar\\}}/else").resolve("weird", "something/{foo}/{bar}/else"));
   assertEquals("bar", PathElement.pathElement("foo/{required}/{optional: .*}").resolve("required", "foo/bar/"));
   assertNull(PathElement.pathElement("foo/{required}/{optional: .*}").resolve("optional", "foo/bar"));
   assertEquals("blah", PathElement.pathElement("foo/{required}/{optional: .*}").resolve("optional", "foo/bar/blah"));
}