### Question:
EncryptedChunk { @Override public int hashCode() { return Objects.hash(mKey, Arrays.hashCode(mNonce), Arrays.hashCode(mEncryptedBytes)); } private  EncryptedChunk(ChunkHash key, byte[] nonce, byte[] encryptedBytes); static EncryptedChunk create(ChunkHash key, byte[] nonce, byte[] encryptedBytes); ChunkHash key(); byte[] nonce(); byte[] encryptedBytes(); @Override boolean equals(Object o); @Override int hashCode(); static final int KEY_LENGTH_BYTES; static final int NONCE_LENGTH_BYTES; }### Answer:
@Test public void testHashCode() { ChunkHash chunkHash1 = new ChunkHash(CHUNK_HASH_1_BYTES); ChunkHash equalChunkHash1 = new ChunkHash(CHUNK_HASH_1_BYTES); ChunkHash chunkHash2 = new ChunkHash(CHUNK_HASH_2_BYTES); EncryptedChunk encryptedChunk1 = EncryptedChunk.create(chunkHash1, NONCE_1, ENCRYPTED_BYTES_1); EncryptedChunk equalEncryptedChunk1 = EncryptedChunk.create(equalChunkHash1, NONCE_1, ENCRYPTED_BYTES_1); EncryptedChunk encryptedChunk2 = EncryptedChunk.create(chunkHash2, NONCE_2, ENCRYPTED_BYTES_2); int hash1 = encryptedChunk1.hashCode(); int equalHash1 = equalEncryptedChunk1.hashCode(); int hash2 = encryptedChunk2.hashCode(); assertThat(hash1).isEqualTo(equalHash1); assertThat(hash1).isNotEqualTo(hash2); }