@Test
public void headersAndPostParams() throws Exception {

    MockHttpStack mockHttpStack = new MockHttpStack();
    InputStream responseStream =
            new ByteArrayInputStream("foobar".getBytes(StandardCharsets.UTF_8));
    HttpResponse fakeResponse =
            new HttpResponse(200, Collections.<Header>emptyList(), 6, responseStream);
    mockHttpStack.setResponseToReturn(fakeResponse);
    BasicNetwork httpNetwork = new BasicNetwork(mockHttpStack);
    Request<String> request = buildRequest();
    Entry entry = new Entry();
    entry.etag = "foobar";
    entry.lastModified = 1503102002000L;
    request.setCacheEntry(entry);
    httpNetwork.performRequest(request);
    assertEquals("foo", mockHttpStack.getLastHeaders().get("requestheader"));
    assertEquals("foobar", mockHttpStack.getLastHeaders().get("If-None-Match"));
    assertEquals(
            "Sat, 19 Aug 2017 00:20:02 GMT",
            mockHttpStack.getLastHeaders().get("If-Modified-Since"));
    assertEquals(
            "requestpost=foo&",
            new String(mockHttpStack.getLastPostBody(), StandardCharsets.UTF_8));
}