title: JAVA 8 Sum function with custom logic
body: <pre><code>Class A{
     Double x;
     Double y
  }
  
  List aList = new ArrayList&lt;&gt;();//It contains list of A class object.
  </code></pre>
  <p>Now I want to get <code>sum(x-y)</code> from above list using Java 8.</p>
  <p>Thanks in advance</p>