### Question:
UriUtil { public static Uri removeQueryParameter(Uri uri, String queryParameterName) { Uri.Builder builder = uri.buildUpon(); builder.clearQuery(); for (String key : uri.getQueryParameterNames()) { if (!key.equals(queryParameterName)) { for (String value : uri.getQueryParameters(key)) { builder.appendQueryParameter(key, value); } } } return builder.build(); } private  UriUtil(); static Uri resolveToUri(String baseUri, String referenceUri); static String resolve(String baseUri, String referenceUri); static Uri removeQueryParameter(Uri uri, String queryParameterName);  }### Answer:
@Test public void removeOnlyQueryParameter() { Uri uri = Uri.parse("http: assertThat(removeQueryParameter(uri, "query").toString()).isEqualTo("http: }
@Test public void removeFirstQueryParameter() { Uri uri = Uri.parse("http: assertThat(removeQueryParameter(uri, "query").toString()).isEqualTo("http: }
@Test public void removeMiddleQueryParameter() { Uri uri = Uri.parse("http: assertThat(removeQueryParameter(uri, "query").toString()) .isEqualTo("http: }
@Test public void removeLastQueryParameter() { Uri uri = Uri.parse("http: assertThat(removeQueryParameter(uri, "query").toString()).isEqualTo("http: }
@Test public void removeNonExistentQueryParameter() { Uri uri = Uri.parse("http: assertThat(removeQueryParameter(uri, "foo").toString()).isEqualTo("http: uri = Uri.parse("http: assertThat(removeQueryParameter(uri, "foo").toString()).isEqualTo("http: }