### Question:
Signature { @Override public int hashCode() { int result = Arrays.hashCode(r); result = 31 * result + Arrays.hashCode(s); return result; } Signature(final BigInteger r, final BigInteger s);  Signature(final byte[] bytes);  Signature(final byte[] r, final byte[] s); BigInteger getR(); byte[] getBinaryR(); BigInteger getS(); byte[] getBinaryS(); byte[] getBytes(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void hashCodesAreEqualForEquivalentObjects() { final Signature signature = createSignature(1235, 7789); final int hashCode = signature.hashCode(); MatcherAssert.assertThat(createSignature(1235, 7789).hashCode(), IsEqual.equalTo(hashCode)); MatcherAssert.assertThat( createSignature(1234, 7789).hashCode(), IsNot.not(IsEqual.equalTo(hashCode))); MatcherAssert.assertThat( createSignature(1235, 7790).hashCode(), IsNot.not(IsEqual.equalTo(hashCode))); MatcherAssert.assertThat(signature, IsNot.not(IsEqual.equalTo("ImNotASignature"))); }