@Test
public void testAddParameter() throws Exception {

    final String url = "some_url";
    final String name = "name";
    final String value = "value";
    final HttpRequest request = new HttpRequest(url, (String)null).addParameter(name, value);
    assertThat(request.getRequestURL(), equalTo(url));
    assertThat(request.getParameters(), equalTo(singletonMap(name, singletonList(value))));
    assertThat(request.getParameters(name), equalTo(singletonList(value)));
    assertThat(request.getParameter(name), equalTo(value));
    final HttpRequest request2 = request.addParameter(name, value);
    assertThat(request2.getParameters(name), equalTo(Arrays.asList(value, value)));
}