@Test
public void testResolveNormal() {

  String base = "http://a/b/c/d;p?q";
  assertThat(resolve(base, "g:h")).isEqualTo("g:h");
  assertThat(resolve(base, "g")).isEqualTo("http://a/b/c/g");
  assertThat(resolve(base, "g/")).isEqualTo("http://a/b/c/g/");
  assertThat(resolve(base, "/g")).isEqualTo("http://a/g");
  assertThat(resolve(base, "//g")).isEqualTo("http://g");
  assertThat(resolve(base, "?y")).isEqualTo("http://a/b/c/d;p?y");
  assertThat(resolve(base, "g?y")).isEqualTo("http://a/b/c/g?y");
  assertThat(resolve(base, "#s")).isEqualTo("http://a/b/c/d;p?q#s");
  assertThat(resolve(base, "g#s")).isEqualTo("http://a/b/c/g#s");
  assertThat(resolve(base, "g?y#s")).isEqualTo("http://a/b/c/g?y#s");
  assertThat(resolve(base, ";x")).isEqualTo("http://a/b/c/;x");
  assertThat(resolve(base, "g;x")).isEqualTo("http://a/b/c/g;x");
  assertThat(resolve(base, "g;x?y#s")).isEqualTo("http://a/b/c/g;x?y#s");
  assertThat(resolve(base, "")).isEqualTo("http://a/b/c/d;p?q");
  assertThat(resolve(base, ".")).isEqualTo("http://a/b/c/");
  assertThat(resolve(base, "./")).isEqualTo("http://a/b/c/");
  assertThat(resolve(base, "..")).isEqualTo("http://a/b/");
  assertThat(resolve(base, "../")).isEqualTo("http://a/b/");
  assertThat(resolve(base, "../g")).isEqualTo("http://a/b/g");
  assertThat(resolve(base, "../..")).isEqualTo("http://a/");
  assertThat(resolve(base, "../../")).isEqualTo("http://a/");
  assertThat(resolve(base, "../../g")).isEqualTo("http://a/g");
}