@SuppressWarnings("deprecation")
@Test
public void create() throws Exception {

  Map<String, Collection<String>> map = new HashMap<String, Collection<String>>();
  map.put("my-header", Arrays.asList("val"));
  Request request =
      Request.create(Request.HttpMethod.GET, "a", map, "content".getBytes(StandardCharsets.UTF_8),
          StandardCharsets.UTF_16);
  requestKey = RequestKey.create(request);
  assertThat(requestKey.getMethod(), equalTo(HttpMethod.GET));
  assertThat(requestKey.getUrl(), equalTo("a"));
  assertThat(requestKey.getHeaders().size(), is(1));
  assertThat(requestKey.getHeaders().fetch("my-header"),
      equalTo((Collection<String>) Arrays.asList("val")));
  assertThat(requestKey.getCharset(), equalTo(StandardCharsets.UTF_16));
  assertThat(requestKey.getBody(), equalTo("content".getBytes(StandardCharsets.UTF_8)));
}