@Test public void testCharSequenceSetEqualsAndHashCode() { List<String> stringColors = Lists.newArrayList( "orange", "green", "blue", "red", "purple", "red"); ImmutableCharSequenceSet strings = new ImmutableCharSequenceSet(stringColors); List<Utf8> utf8Colors = Lists.newArrayList( new Utf8("orange"), new Utf8("green"), new Utf8("blue"), new Utf8("red"), new Utf8("purple"), new Utf8("red")); ImmutableCharSequenceSet utf8s = new ImmutableCharSequenceSet(utf8Colors); Assert.assertEquals("Identical String and Utf8 sets should be equal", strings, utf8s); Assert.assertEquals("Sets equal => hash codes equal", strings.hashCode(), utf8s.hashCode()); }
public static int hashCode(CharSequence seq) { final int prime = 37; int result = 13; for (int i = 0, n = seq.length(); i < n; i += 1) { result = prime * result + seq.charAt(i); } return result; }
CharSequences { public static int hashCode(CharSequence seq) { final int prime = 37; int result = 13; for (int i = 0, n = seq.length(); i < n; i += 1) { result = prime * result + seq.charAt(i); } return result; } }
CharSequences { public static int hashCode(CharSequence seq) { final int prime = 37; int result = 13; for (int i = 0, n = seq.length(); i < n; i += 1) { result = prime * result + seq.charAt(i); } return result; }  }
CharSequences { public static int hashCode(CharSequence seq) { final int prime = 37; int result = 13; for (int i = 0, n = seq.length(); i < n; i += 1) { result = prime * result + seq.charAt(i); } return result; }  static int compare(CharSequence left, CharSequence right); static int hashCode(CharSequence seq); }
CharSequences { public static int hashCode(CharSequence seq) { final int prime = 37; int result = 13; for (int i = 0, n = seq.length(); i < n; i += 1) { result = prime * result + seq.charAt(i); } return result; }  static int compare(CharSequence left, CharSequence right); static int hashCode(CharSequence seq);  }