title: Proper use of HashSet.contains()?
body: <p>I'm attempting to generate a maze using a version of Kruskal's algorithm. I need to check if some coordinates (in an int[] array, eg [1, 5]) are in an existing set.</p>
  
  <p>Here is a copy of the part of the code;</p>
  
  <pre><code>// find sets containing cells to be joined
  for (HashSet&lt;int[]&gt; h : cells) {
      if (h.contains(new int[]{x, y - 2})) {
          set1 = h;
      }
  }
  </code></pre>
  
  <p>The issue is that the if statement is never true, but I'm 99.9% sure it should be true at least once.</p>
  
  <p>Am I using HashSet.contains() wrong?</p>
  
  <p>Thanks</p>