title: How to collect two sum from a stream in Java 8
body: <pre><code>class Stock{
     double profit;
     double profitPercentage;
     public double getProfit(){
        return profit;
     }
     public double getProfitPercentage(){
        return profitPercentage;
     }
  }
  List&lt;Stock&gt; stocks = getAllStocks();
  stocks.stream.collect(Collectors.summarizingDouble(Stock:getProfit)).getSum();
  stocks.stream.collect(Collectors.summarizingDouble(Stock:getProfitPercentage)).getSum();
  </code></pre>
  
  <p>I could not find out way to do in single pass of stream. Any help or pointer would be good.</p>