title: Best way to categorize a list
body: <p>I have an Order object </p>
  
  <pre><code>public class Order{
    private Date orderDate;
    //other fields + getters &amp; setters
  }
  </code></pre>
  
  <p>And a List of Orders (<strong>List&lt; Orders></strong>). Now I want to group this list of orders based on similar orderDate (similar in here means, same year, month and day) and produce a map like this:</p>
  
  <pre><code>Map&lt;Date, List&lt;Order&gt;&gt; orderMap = new HashMap&lt;&gt;();
  </code></pre>
  
  <p>How to do this in Java 8+ ?</p>
  
  <blockquote>
    <p>Take note we might have similar date but different timestamp which means we
    want to based it on "year, month, day"</p>
  </blockquote>