@Test public void hashCode_works() throws Exception { SafeString a = new SafeString("this is a test"); SafeString b = new SafeString("this is a test"); SafeString c = new SafeString("this is a third test"); assertEquals(a.hashCode(), b.hashCode()); assertEquals(a.hashCode(), "this is a test".hashCode()); assertFalse(a.hashCode() == c.hashCode()); }
@Override public int hashCode() { return mString.hashCode(); }
SafeString implements CharSequence, Serializable { @Override public int hashCode() { return mString.hashCode(); } }
SafeString implements CharSequence, Serializable { @Override public int hashCode() { return mString.hashCode(); } SafeString(@NonNull String s); }
SafeString implements CharSequence, Serializable { @Override public int hashCode() { return mString.hashCode(); } SafeString(@NonNull String s); boolean isEmpty(); @Override int length(); @Override char charAt(int index); @Override CharSequence subSequence(int start, int end); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); }
SafeString implements CharSequence, Serializable { @Override public int hashCode() { return mString.hashCode(); } SafeString(@NonNull String s); boolean isEmpty(); @Override int length(); @Override char charAt(int index); @Override CharSequence subSequence(int start, int end); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode();  }