@Test
public void removeLastQueryParameter() {

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