title: Reduce and assign using Stream api for multiple variables
body: <p>I need to do following in lambda but unable to think of way where single stream and reducing(s) can help :(</p>
  
  <p>I have Employee ArrayList where <strong>name</strong> member variable can be duplicate across object in list. I need to create map where key is employee name and value is object where we have <strong>sum</strong> of cost1 and cost2 for that employee.</p>
  
  <p><strong>Employee class</strong> has -> String name, Integer cost1, Integer cost2</p>
  
  <p><strong>Output class</strong> has -> Integer cost1, Integer cost2</p>
  
  <pre><code>List &lt;Employee&gt; employeeList = new ArrayList&lt;&gt;();
  // data population in inputMap
  Map&lt;String, Output&gt; outputMap = new HashMap&lt;&gt;();
  for (Employee emp : employeeList)
  {
      Output op = outputMap.get(emp.getName());
      if(op == null){
        Output newOp = new Output ();
        newOp.setCost1(emp.getCost1())
        newOp.setCost2(emp.getCost2())
        newOp.put(emp.getName(), newOp);
      }else{
         int cost1 = op.getCost1() + emp.getCost1();
         int cost2 = op.getCost2() + emp.getCost2();
         op.setCost1(cost1);
         op.setCost2(cost2);
         newOp.put(emp.getName(), op);
      }
  }
  </code></pre>