title: Compare objects in LinkedList.contains()
body: <p>I want to be able to have LinkedList.contains() return true for a custom comparator.</p>
  
  <p>Suppose that I have 1 LinkedList and 2 objects</p>
  
  <pre><code>LinkedList&lt;MyObject&gt; myList = new LinkedList&lt;MyObject&gt;();
  
  MyObject a = new MyObject("HELLO");
  MyObject b = new MyObject("HELLO");
  </code></pre>
  
  <p>Technicaly, both objects are identical in terms of comparison (MyObject implements Comparable) </p>
  
  <p>( a == b ) == true</p>
  
  <p>however, when I do the following, myList does not return true for myList.contains(b)</p>
  
  <pre><code>myList.add(a)
  myList.contains(b) // == false
  </code></pre>
  
  <p>I think its because contains will check object reference and see that a and b are 2 distinct objects.
  Is there any way I can make it so I don't have to extend LinkedList to compare those objects?</p>