title: sum of duplicates data list on java
body: <p>I have this code</p>
  <pre><code>    ... some code here
  
      while (iterator.hasNext()) {
        Document next = iterator.next();
  
        projectNumber = new NpoProjectNumberVM();
        localDate = new java.sql.Date(((Date) next.get(&quot;_id&quot;)).getTime()).toLocalDate();
        projectNumber.setDay(localDate);
        projectNumber.setNumber(((Long) next.get(&quot;number&quot;)).intValue());
        projectNumberList.add(projectNumber);
      }
  
      return projectNumberList;
  </code></pre>
  <p>which displays this result</p>
  <pre><code> &quot;projectNumber&quot;: [
          {
              &quot;day&quot;: &quot;2022-02-07&quot;,
              &quot;number&quot;: 2
          },
          {
              &quot;day&quot;: &quot;2022-02-07&quot;,
              &quot;number&quot;: 1
          },
          {
              &quot;day&quot;: &quot;2022-02-07&quot;,
              &quot;number&quot;: 4
          },
      ]
  </code></pre>
  <p>My request is: I want to have the sum of the numbers for the same date like this</p>
  <pre><code> &quot;projectNumber&quot;: [
          {
              &quot;day&quot;: &quot;2022-02-07&quot;,
              &quot;number&quot;: 7
          },
      ]
  </code></pre>