How do I write my own comparison operator in Java?
<p>I’ve got a <code>List&lt;MyObject&gt; list</code></p>

<p>And, I want to make use out of the <code>list.contains()</code> function.</p>

<p>It doesn’t seem to work at the moment, i.e. there are objects in the list that match, but is not being picked up by the comparator operator.</p>

<p>I’m guessing I need to write my own comparison operator in <code>MyObject</code>. What is the way to go about this?</p>
