class 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);
    public  HeadersImpl();
    public  HeadersImpl(Headers headers, boolean readOnly);

}