### Question:
HexString implements Serializable { @Override public int hashCode() { return Arrays.hashCode(this.bytes); } HexString(String hexString); private  HexString(byte[] bytes); byte[] getBytes(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); static HexString valueOf(byte[] bytes); static String toString(byte[] bytes); static String toString(byte[] bytes, int offset, int length); static char[] toChars(byte[] bytes); static char[] toChars(byte[] bytes, int offset, int length); static byte[] toBytes(String hexString);  }### Answer:
@Test public void shouldImplementHashCodeAndEquals() throws Exception { HexString h1 = new HexString(STRING); HexString h2 = new HexString(STRING); HexString h3 = new HexString("0000"); assertThat(h1.hashCode(), is(equalTo(h2.hashCode()))); assertThat(h1, is(equalTo(h2))); assertThat(h1, is(equalTo(h2))); assertThat(h1.hashCode(), is(not(equalTo(h3.hashCode())))); assertThat(h1, is(not(equalTo(h3)))); }