Code example for BasicHeader

    public Header getFirstHeader(String name) {
        String value = getHeaders().getHeaders().get(name);
        if (value == null)
            return null; 
        return new BasicHeader(name, value);
    public Header[] getHeaders(String name) {
        Map<String, List<String>> map = getHeaders().getHeaders().toMultimap();
        List<String> vals = map.get(name);
        if (vals == null)
            return new Header[0];
        Header[] ret = new Header[vals.size()];
        for (int i = 0; i < ret.length; i++)
            ret[i] = new BasicHeader(name, vals.get(i));
        return ret;
Connect your IDE to all the code out there  Get Codota for Java