title: How to return false if a java collection contains two identical elements
body: <p>I have a <code>Collection&lt;Event&gt;</code>. <code>Event</code> looks something like this</p>
  
  <pre><code>public class Event {
  
     private Integer id;
     private LocalDateTime localDateTime;
  
     // getters, setters omitted
  </code></pre>
  
  <p>}</p>
  
  <p>Each <code>Event</code> in that <code>Collection</code> needs to have a unique <code>id</code> and <code>localDateTime</code>. How can I do that check using stream API and return true if the condition is satisfied?</p>