HttpHeadersImpl implements HttpHeaders { @Override public String getHeaderString(String name) { List<String> headerValues = nettyHttpHeaders.getAll(name); if (headerValues == null) { return null; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < headerValues.size(); i++) { String value = headerValues.get(i); if (value == null || value.isEmpty()) { continue; } sb.append(value); if (i + 1 < headerValues.size()) { sb.append(","); } } return sb.toString(); } 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 testGetHeaderString() throws Exception { String headerValue = httpHeaders1.getHeaderString("testA"); assertEquals(headerValue, "test1,test2"); headerValue = httpHeaders1.getHeaderString("Accept"); assertEquals(headerValue, "application/json"); }