@Override
  public Map<String, Object> payload() {
    return new HashMap<>(payloadAsMap);
  }
@Test
  public void testSetAndUpdatePayload() {
    HttpRequestImpl request = new HttpRequestImpl("GET", "/", client);
    request.payload("hello", "world");
    assertEquals(singletonMap("hello", "world"), request.payload());
    request.payload("hello", "again");
    assertEquals(singletonMap("hello", "again"), request.payload());
    request.payload("ob", "one");
    request.payload("ken", "ob");
    assertEquals(3, request.payload().size());
    assertEquals("one", request.payload().get("ob"));
    assertEquals("ob", request.payload().get("ken"));
    assertEquals("again", request.payload().get("hello"));

    Map<String, Object> payload = new HashMap<>();
    payload.put("ob", "two");
    payload.put("three", "three");
    request.payload(payload).payload("four", 4);
    assertEquals("two", request.payload().get("ob"));
    assertEquals("three", request.payload().get("three"));
    assertEquals(4, request.payload().get("four"));

    new EqualsTester()
        .addEqualityGroup(request)
        .addEqualityGroup(request())
        .addEqualityGroup(
            request().payload("one", "one").payload("two", "two"),
            request().payload("two", "two").payload("one", "one")
        ).addEqualityGroup(request().payload("one", "one"))
        .testEquals();
  }