@Test
public void removeMiddleQueryParameter() {

  Uri uri = Uri.parse("http://uri?first=value1&query=value&last=value2");
  assertThat(removeQueryParameter(uri, "query").toString())
      .isEqualTo("http://uri?first=value1&last=value2");
}