### Question:
EncryptedChunk { public static EncryptedChunk create(ChunkHash key, byte[] nonce, byte[] encryptedBytes) { Preconditions.checkArgument( nonce.length == NONCE_LENGTH_BYTES, "Nonce does not have the correct length."); return new EncryptedChunk(key, nonce, encryptedBytes); } 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 testCreate_withIncorrectLength_throwsException() { ChunkHash chunkHash = new ChunkHash(CHUNK_HASH_1_BYTES); byte[] shortNonce = Arrays.copyOf(new byte[] {2}, EncryptedChunk.NONCE_LENGTH_BYTES - 1); assertThrows( IllegalArgumentException.class, () -> EncryptedChunk.create(chunkHash, shortNonce, ENCRYPTED_BYTES_1)); }