title: In Java 8 how do I transform a Map<K,V> to another Map<K,V> using a lambda?
body: <p>I've just started looking at Java 8 and to try out lambdas I thought I'd try to rewrite a very simple thing I wrote recently.  I need to turn a Map of String to Column into another Map of String to Column where the Column in the new Map is a defensive copy of the Column in the first Map.  Column has a copy constructor.  The closest I've got so far is:</p>
  
  <pre><code>    Map&lt;String, Column&gt; newColumnMap= new HashMap&lt;&gt;();
      originalColumnMap.entrySet().stream().forEach(x -&gt; newColumnMap.put(x.getKey(), new Column(x.getValue())));
  </code></pre>
  
  <p>but I'm sure there must be a nicer way to do it and I'd be grateful for some advice.</p>