### Question:
HttpHeadersImpl implements HttpHeaders { public int getLength() { List<String> values = headers.get(HttpHeaders.CONTENT_LENGTH); if (values == null || values.size() != 1) { return -1; } return HttpUtils.getContentLength(values.get(0)); } HttpHeadersImpl(Message message); List<MediaType> getAcceptableMediaTypes(); Map<String, Cookie> getCookies(); Locale getLanguage(); MediaType getMediaType(); MultivaluedMap<String, String> getRequestHeaders(); List<Locale> getAcceptableLanguages(); List<String> getRequestHeader(String name); Date getDate(); String getHeaderString(String headerName); int getLength();  }### Answer:
@Test public void testGetMissingContentLength() throws Exception { Message m = createMessage(new MetadataMap<String, String>()); HttpHeaders h = new HttpHeadersImpl(m); assertEquals(-1, h.getLength()); }
@Test public void testGetContentLength() throws Exception { Message m = createMessage(createHeaders()); HttpHeaders h = new HttpHeadersImpl(m); assertEquals(10, h.getLength()); }