title: return filtred list of java objects based on property value
body: <p>Let's suppose that i have an Array of objects (Payment) :</p>
  <pre><code>listPayments=[Payment(type='check', amount=25),Payment(type='cash', amount=20),Payment(type='check', amount=25),Payment(type='cash', amount=20)]
  </code></pre>
  <p>i want to get an array that contains objects with amount sum based on payment type like so :</p>
  <pre><code>filtredList = [Payment(type='check', amount=50),Payment(type='cash', amount=40)]
  </code></pre>
  <p>But <em><strong>i don't want to hard code the type</strong></em> because i can have multiple payment types, can you help me to find a generic way to do this, thanks in advance.</p>