title: How to use double colon in Stream.collect for HashMap?
body: <p>I want to read a csv file into a hashmap by using the first column as a key, the second column as a value, and ignoring the third column.  </p>
  
  <p>I wrote the following code and it works. I would like to know how to rewrite the syntax with double colon "::".   </p>
  
  <p>I check the API docs, but most of examples are using List instead of Map.   </p>
  
  <p>I used a string to mock a csv file: "A,1,!","B,2,@","C,3,#","D,4,$","E,5,%"    </p>
  
  <pre><code>Map&lt;String,String&gt; maps = Stream.of("A,1,!","B,2,@","C,3,#","D,4,$","E,5,%")
        .collect(() -&gt; new HashMap&lt;String,String&gt;(),
                 (map, line) -&gt; {String x[] = line.split(","); map.put(x[0],x[1]);},
                 (map1, map2) -&gt; map1.putAll(map2));
  System.out.println(maps);
  </code></pre>
  
  <p>Thanks,<br>
  Ian</p>