class HttpRequestBuilder {

    public void removeHeaderIgnoreCase(String name) {
        if (headers == null || name == null) {
            return;
        }
        List<String> list = headers.keySet().stream()
                .filter(k -> name.equalsIgnoreCase(k))
                .collect(Collectors.toList());
        // has to be separate step else concurrent modification exception
        list.forEach(k -> headers.remove(k));
    }

}