title: How to convert a CSV file to List<Map<String,String>>
body: <p>I have a CSV file which has a header in the first line. I want to convert it to <code>List&lt;Map&lt;String, String&gt;&gt;</code>, where each <code>Map&lt;String, String&gt;</code> in the list represents a record in the file. The key of the map is the header and the value is the actual value of the field.
  What I have so far:</p>
  
  <pre><code>BufferedReader br = &lt;handle to file&gt;;
  // Get the headers to build the map.
  String[] headers = br.lines().limit(1).collect(Collectors.toArray(size -&gt; new String[size]));
  Stream&lt;String&gt; recordStream = br.lines().skip(1);
  </code></pre>
  
  <p>What further operations can I perform on <code>recordStream</code> so that I can transform it to <code>List&lt;Map&lt;String, String&gt;&gt;</code>?</p>
  
  <p>Sample CSV file is:</p>
  
  <pre><code>header1,header2,header3   ---- Header line
  field11,field12,field13   ----&gt; need to transform to Map where entry would be like header1:field11 header2:field12 and so on.
  field21,field22,field23
  field31,field32,field33
  </code></pre>
  
  <p>Finally all these Maps need to be collected to a List.</p>