title: How to populate a HashMap using a Lambda Expression
body: <p>There is one class (<code>SomeOrders</code>), which has few fields like <code>Id</code>, <code>Summary</code>, <code>Amount</code>, etc...</p>
  
  <p>The requirement is to collect <code>Id</code> as key and <code>Summary</code> as value to a <code>HashMap</code> from an input <code>List</code> of <code>SomeOrder</code> objects.</p>
  
  <p>Code in Before java 8:</p>
  
  <pre><code>List&lt;SomeOrder&gt; orders = getOrders();
  Map&lt;String, String&gt; map = new HashMap&lt;&gt;();
  for (SomeOrder order : orders) {
      map.put(order.getId(), order.getSummary());
  }
  </code></pre>
  
  <p>How to achieve the same with Lambda expression in Java 8?</p>