title: contains method ignores equals override
body: <p>Having <code>Node</code> abstract class which <code>Cell</code> extends him .</p>
  
  <p>In <code>Cell</code> I implemented <code>public boolean equals(Node cmpCell)</code> . I <code>created Set&lt;Node&gt; closeList = new HashSet&lt;Node&gt;();</code> and when I execute <code>closeList.contains((Cell) node)</code> I debugged it and detect that it utterly ignores <code>Cell equals</code> I implemented . What I did wrong ? </p>
  
  <p><strong>Edit :</strong></p>
  
  <p>I changed in <code>Cell</code> to </p>
  
  <pre><code>@Override
  public boolean equals(Object cmpCell)
  </code></pre>
  
  <p>and still <code>closeList.contains((Cell) node)</code> doesn't using the above override  .</p>
  
  <p><strong>2nd Edit :</strong></p>
  
  <p>In <code>Cell</code> class there is 2 members  - </p>
  
  <pre><code>int colIndex ;
  int rowIndex ;
  </code></pre>
  
  <p>the <code>equals</code> override just compare them to that both members of the 2nd class  , I think it would be better I use <code>HashMap&lt;K, V&gt;</code> but still I would be glade to know how the <code>hashCode</code> should be looks like in such case  ? </p>