### Question:
AesSpillCipher implements SpillCipher { @Override public void close() { this.key = null; this.encryptSizer = null; } AesSpillCipher(); @Override int encryptedMaxLength(int inputLength); @Override int decryptedMaxLength(int encryptedLength); @Override int encrypt(byte[] data, int inputOffset, int length, byte[] destination, int destinationOffset); @Override int decrypt(byte[] encryptedData, int inputOffset, int length, byte[] destination, int destinationOffset); @Override void close(); @Override String toString();  }### Answer:
@Test public void test() { AesSpillCipher spillCipher = new AesSpillCipher(); for (int size = 0; size <= 257; size++) { byte[] data = randomBytes(size); byte[] encrypted = encryptExact(spillCipher, data.clone()); assertEquals(data, decryptExact(spillCipher, encrypted)); } assertNotEquals(encryptExact(spillCipher, new byte[0]), encryptExact(spillCipher, new byte[0]), "IV values must not be reused"); byte[] encrypted = encryptExact(spillCipher, randomBytes(1)); spillCipher.close(); spillCipher.close(); assertFailure(() -> decryptExact(spillCipher, encrypted), "Spill cipher already closed"); assertFailure(() -> encryptExact(spillCipher, randomBytes(1)), "Spill cipher already closed"); }