HttpHeadersImpl implements HttpHeaders { @Override public MultivaluedMap<String, String> getRequestHeaders() { MultivaluedHashMap<String, String> newHeaders = new MultivaluedHashMap<>(); for (Map.Entry<String, String> headerEntry : nettyHttpHeaders.entries()) { if (headerEntry != null) { newHeaders.add(headerEntry.getKey(), headerEntry.getValue()); } } return newHeaders; } HttpHeadersImpl(io.netty.handler.codec.http.HttpHeaders httpHeaders); @Override List<String> getRequestHeader(String name); @Override String getHeaderString(String name); @Override MultivaluedMap<String, String> getRequestHeaders(); @Override List<MediaType> getAcceptableMediaTypes(); @Override List<Locale> getAcceptableLanguages(); @Override MediaType getMediaType(); @Override Locale getLanguage(); @Override Map<String, Cookie> getCookies(); @Override Date getDate(); @Override int getLength();  }
@Test public void testGetRequestHeaders() throws Exception { MultivaluedMap<String, String> headersMap = httpHeaders1.getRequestHeaders(); List<String> headerValues = headersMap.get("testA"); assertEquals(headerValues.size(), 2); assertTrue(headerValues.contains("test1")); assertTrue(headerValues.contains("test2")); headerValues = headersMap.get("Accept"); assertEquals(headerValues.size(), 1); assertTrue(headerValues.contains("application/json")); }