@Test
public void testRelativizeToBaseParent() throws Exception {

    final URI fooOpaque = new URI("mailto:foo@bar.com");
    final URI barOpaque = new URL("http://bar.com").toURI();
    assertSame("return uri when opaque",
            barOpaque, OakpalPlan.relativizeToBaseParent(fooOpaque, barOpaque));
    final URI barOneJson = new URL("http://bar.com/one.json").toURI();
    final URI barTwoJson = new URL("http://bar.com/two.json").toURI();
    final URI barTwoRel = new URI("two.json");
    assertEquals("return relative uri when base is not json",
            barTwoRel, OakpalPlan.relativizeToBaseParent(barOneJson, barTwoJson));
    final URI fooRoot = new URL("http://foo.com/").toURI();
    final URI fooAbs = new URL("http://foo.com/file.json").toURI();
    final URI fooRel = new URI("file.json");
    assertEquals("return relative uri when base is not json",
            fooRel, OakpalPlan.relativizeToBaseParent(fooRoot, fooAbs));
}