### Question:
HashData { @Override public int hashCode() { return sha1.hashCode(); } HashData(
    byte[] sha1, byte[] md5, byte[] crc32, String name, long size,
    int prod_code, String os_code, String special_code); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); final byte[] sha1; final byte[] md5; final byte[] crc32; final String name; final long size; final int prod_code; final String os_code; final String special_code; }### Answer:
@Test public void hashCodeSelf() { final HashData hd = new HashData( sha1, md5, crc32, name, size, prod_code, os_code, special_code); assertTrue(hd.hashCode() == hd.hashCode()); }
@Test public void hashCodeSame() { final HashData a = new HashData( sha1, md5, crc32, name, size, prod_code, os_code, special_code); final HashData b = new HashData( sha1, md5, crc32, name, size, prod_code, os_code, special_code); assertTrue(a.hashCode() == b.hashCode()); }
@Test public void hashCodeDifferent() throws DecoderException { final byte[] sha1alt = (byte[]) hex.decode("0000000000000000000000000000000000000000"); final HashData a = new HashData( sha1, md5, crc32, name, size, prod_code, os_code, special_code); final HashData b = new HashData( sha1alt, md5, crc32, name, size, prod_code, os_code, special_code); assertTrue(a.hashCode() != b.hashCode()); }