### Question:
HttpMessageSupport { public static boolean chunked(HttpHeaders headers) { for (String value : headers.getAll(TRANSFER_ENCODING)) { if (value.equalsIgnoreCase(CHUNKED.toString())) { return true; } } return false; } private  HttpMessageSupport(); static boolean chunked(HttpHeaders headers); static boolean keepAlive(HttpHeaders headers, HttpVersion version);  }### Answer:
@Test public void chunkedReturnsTrueWhenChunkedTransferEncodingIsSet() { HttpHeaders headers = requestBuilder() .header(TRANSFER_ENCODING, CHUNKED) .build() .headers(); assertThat(chunked(headers), is(true)); HttpHeaders headers2 = requestBuilder() .header(TRANSFER_ENCODING, "foo") .addHeader(TRANSFER_ENCODING, CHUNKED) .addHeader(TRANSFER_ENCODING, "bar") .build() .headers(); assertThat(chunked(headers2), is(true)); }
@Test public void chunkedReturnsFalseWhenChunkedTransferEncodingIsNotSet() { HttpHeaders headers = requestBuilder() .header(TRANSFER_ENCODING, "foo") .build() .headers(); assertThat(chunked(headers), is(false)); }
@Test public void chunkedReturnsTrueWhenChunkedTransferEncodingIsAbsent() { HttpHeaders headers = requestBuilder().build().headers(); assertThat(chunked(headers), is(false)); }