private List<String> toListOfStrings(String headerName, List<Object> values) {
        if (values == null) {
            return null;
        }
        List<String> stringValues = new ArrayList<>(values.size());
        HeaderDelegate<Object> hd = HttpUtils.getHeaderDelegate(values.get(0));
        for (Object value : values) {
            String actualValue = hd == null ? value.toString() : hd.toString(value);
            stringValues.add(actualValue);
        }
        return stringValues;
    }
private List < String > toListOfStrings ( String headerName , List < Object > values ) { if ( values == null ) { return null ; } List < String > stringValues = new ArrayList < > ( values . size ( ) ) ; HeaderDelegate < Object > hd = HttpUtils . getHeaderDelegate ( values . get ( 0 ) ) ; for ( Object value : values ) { String actualValue = hd == null ? value . toString ( ) : hd . toString ( value ) ; stringValues . add ( actualValue ) ; } return stringValues ; }
This conversion is needed as some values may not be Strings