title: Java Set collection - override equals method
body: <p>Is there any way to override the the <code>equals</code> method used by a <code>Set</code> datatype? I wrote a custom <code>equals</code> method for a class called <code>Fee</code>. Now I have a <code>LnkedList</code> of <code>Fee</code> and I want to ensure that there are no duplicated entries. Thus I am considering using a <code>Set</code> insted of a <code>LinkedList</code>, but the criteria for deciding if two fees are equal resides in the overriden <code>equals</code> method in the <code>Fee</code> class.</p>
  
  <p>If using a <code>LinkedList</code>, I will have to iterate over every list item and call the overriden <code>equals</code> method in the <code>Fee</code> class with the remaining entries as a parameter. Just reading this alone sounds like too much processing and will add to computational complexity.</p>
  
  <p>Can I use <code>Set</code> with an overridden <code>equals</code> method? Should I?</p>