### Question:
EncryptedChunk { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof EncryptedChunk)) { return false; } EncryptedChunk encryptedChunkOrdering = (EncryptedChunk) o; return Arrays.equals(mEncryptedBytes, encryptedChunkOrdering.mEncryptedBytes) && Arrays.equals(mNonce, encryptedChunkOrdering.mNonce) && mKey.equals(encryptedChunkOrdering.mKey); } 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 testEquals() { 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); assertThat(encryptedChunk1).isEqualTo(equalEncryptedChunk1); assertThat(encryptedChunk1).isNotEqualTo(encryptedChunk2); }