title: How to configure Java Priority Queue to ignore duplicates?
body: <p>I thought add() is supposed to ignore duplicates, but my output has duplicates. How do I not store duplicates?</p>
  
  <p>I would also like to know how the priority queue checks if two elements are duplicates. I'm guessing it's using the comparator equals, but I just want to be sure.</p>
  
  <p>Thanks</p>