protected static Map < String , String > getHeadersAsMap ( ResponseEntity response ) { Map < String , List < String > > headers = new HashMap <> ( response . getHeaders ( ) ) ; Map < String , String > map = new HashMap <> ( ) ; for ( Map . Entry < String , List < String > > header : headers . entrySet ( ) ) { String headerValue = Joiner . on ( "," ) . join ( header . getValue ( ) ) ; map . put ( header . getKey ( ) , headerValue ) ; } return map ; }
Flat the map of list of string to map of strings with theoriginal values seperated by comma