### Question:
Uris { public static UriBuilder uriBuilder(CharSequence template) { return new UriBuilder(template); }  static UriBuilder uriBuilder(CharSequence template); static UriBuilder uriBuilder(URI uri); static boolean lastCharIsToken(CharSequence left, char token); static char lastChar(CharSequence in); static char firstChar(CharSequence in); static boolean isToken(CharSequence right, char token);  }### Answer:
@Test(dataProvider = "strings") public void testQuery(String val) { assertThat(uriBuilder("https: .isEqualTo("moo=" + val); assertThat(uriBuilder("https: .isEqualTo("moo=" + urlEncode(val, '/', ',')); assertThat(uriBuilder("https: .getQuery()) .isEqualTo("foo=bar&kung=fu&moo=" + val); assertThat(uriBuilder("https: .getRawQuery()) .isEqualTo("foo=bar&kung=fu&moo=" + urlEncode(val, '/', ',')); assertThat(uriBuilder("https: .isEqualTo("moo=" + val); assertThat(uriBuilder("https: .isEqualTo("https: assertThat(uriBuilder("https: .getRawQuery()) .isEqualTo("moo=" + urlEncode(val, '/', ',')); assertThat(uriBuilder("https: .getPath()) .isEqualTo("/repos/bob"); }
@Test(dataProvider = "strings") public void testReplaceQueryIsEncoded(String key) { assertThat(uriBuilder("/redirect").addQuery("foo", key).build().getQuery()).isEqualTo("foo=" + key); assertThat(uriBuilder("/redirect").addQuery("foo", key).build().getRawQuery()) .isEqualTo("foo=" + urlEncode(key, '/', ',')); }
@Test(dataProvider = "strings") public void testQuery(String val) { assertEquals(uriBuilder("https: assertEquals(uriBuilder("https: + urlEncode(val, '/', ',')); assertEquals(uriBuilder("https: "https: assertEquals(uriBuilder("https: "https: assertEquals(uriBuilder("https: "https: assertEquals( uriBuilder("https: "https: }
@Test(dataProvider = "strings") public void testPath(String path) { assertEquals(uriBuilder("https: assertEquals(uriBuilder("https: + urlEncode(path, '/', ':', ';', '=')); assertEquals(uriBuilder("https: "https: assertEquals(uriBuilder("https: "https: assertEquals(uriBuilder("https: + path); assertEquals(uriBuilder("https: "https: }
@Test(dataProvider = "strings") public void testAppendPath(String path) { assertEquals(uriBuilder("https: assertEquals(uriBuilder("https: + urlEncode(path, '/', ':', ';', '=')); assertEquals(uriBuilder("https: "https: assertEquals(uriBuilder("https: "https: assertEquals(uriBuilder("https: "https: assertEquals(uriBuilder("https: .toASCIIString(), "https: }
@Test public void testNoDoubleSlashInPath() { assertEquals(uriBuilder("https: }
@Test public void testWhenUrnInPath() { assertEquals(uriBuilder("https: "https: }
@Test public void testWhenMatrixOnPath() { assertEquals( uriBuilder("https: .toASCIIString(), "https: }
@Test(dataProvider = "strings") public void testReplaceQueryIsEncoded(String key) { assertEquals(uriBuilder("/redirect").addQuery("foo", key).toString(), "/redirect?foo=" + key); assertEquals(uriBuilder("/redirect").addQuery("foo", key).build().toString(), "/redirect?foo=" + urlEncode(key, '/', ',')); }