title: How to count number of custom objects in list which have same value for one of its attribute
body: <p>I am programming in java. Say I have an custom object Item</p>
  
  <pre><code>class Item
  {
       Integer id;
       BigDecimal itemNumber;
  }
  </code></pre>
  
  <p>I have list of Items.</p>
  
  <pre><code>List&lt;Item&gt; items = new ArrayList&lt;&gt;();
  </code></pre>
  
  <p>Now, What is best way in java to know, list of <code>Items</code> contain some <code>Items</code> with same value for <code>itemNumber</code>.</p>