title: what does java8 stream map do here?
body: <p>I was confused about the difference between <code>map()</code> and <code>forEach()</code> method in java8 stream. For instance,</p>
  
  <pre><code>List&lt;String&gt; strings = Lists.newArrayList("1", "2");
  Map&lt;String, String&gt; map = Maps.newHashMap();
  strings.stream().map(s-&gt;map.put(s, s));
  System.out.println(map);
  </code></pre>
  
  <p>I got empty output here, but if I change map to <code>forEach()</code> just like</p>
  
  <pre><code>List&lt;String&gt; strings = Lists.newArrayList("1", "2");
  Map&lt;String, String&gt; map = Maps.newHashMap();
  strings.stream().forEach(s-&gt;map.put(s, s));
  System.out.println(map);
  </code></pre>
  
  <p>I can get </p>
  
  <blockquote>
    <p>{1=1, 2=2}</p>
  </blockquote>
  
  <p>Why it just didn't run <code>map()</code> method? What's difference between them?</p>