@Test
public void serializeUsesConfiguration() throws IOException, InterruptedException,
        ExecutionException {

    server.enqueue(new MockResponse().setBody("{}"));
    GsonRequest<AnImplementation> request =
            new GsonRequest<AnImplementation>(Request.Method.POST,
                    server.url("").toString(), AnImplementation.class)
                    .setRequestData(new AnImplementation(null));
    queue.add(request).getFuture().get();
    RecordedRequest sRequest = server.takeRequest();
    assertThat(sRequest.getBody().readUtf8()).isEqualTo("{}"); // Null value was not serialized.
    assertThat(sRequest.getHeader("Content-Type")).isEqualTo("application/json; charset=UTF-8");
    assertThat(sRequest.getHeader("Accept")).isEqualTo("application/json");
}