title: Checking containment in a Set of strings in Java
body: <p>I have a Set of String[]. I want to check whether this Set contains another String[].  </p>
  
  <pre><code>Set&lt;String[]&gt; s  = new HashSet&lt;String[]&gt;();
  s.add(new String[] {"lucy", "simon"});
  System.out.println(s.contains(new String[] {"lucy", "simon"}));
  </code></pre>
  
  <p>However, false is printed. My guess is this is because only the references are being compared and not the actual Strings. It seems, the only option I have is to create a class, say Phrase, and implement <code>hashCode()</code> and <code>equals()</code> (that use <code>Arrays.hashCode(...)</code>). </p>
  
  <p>Is there any other way to achieve what I want? </p>