HeadersImpl implements Headers { @Override public List<String> get(String headerName) { String caseInsensitiveHeaderName = caseMapping.get(headerName); if (caseInsensitiveHeaderName == null) { caseMapping.put(headerName, headerName); caseInsensitiveHeaderName = headerName; } final List<String> list = headers.get(caseInsensitiveHeaderName); if (list == null) { if (readOnly) { return Collections.emptyList(); } else { List<String> newList = new ArrayList<>(); headers.put(caseInsensitiveHeaderName, newList); return newList; } } else { return readOnly ? Collections.unmodifiableList(list) : list; } } private  HeadersImpl(boolean readOnly);  HeadersImpl();  HeadersImpl(Headers headers, boolean readOnly); @Override List<String> get(String headerName); @Override void add(String headerName, String value); @Override void put(String headerName, String value); @Override String getFirst(String headerName); @Override Set<String> headerNames(); @Override long getContentLength(); @Override void setContentLength(long contentLength); @Override ContentType getContentType(); @Override void setContentType(ContentType contentType);  }
@Test public void shouldReturnEmptyListForUnknownHeaders() { final HeadersImpl headers = new HeadersImpl(); assertEquals(emptyList(), headers.get("Content-Type")); }