### Question:
AesGcmHkdfAeadCrypter implements AeadCrypter { @Override public void encrypt(ByteBuffer ciphertext, ByteBuffer plaintext, byte[] nonce) throws GeneralSecurityException { maybeRekey(nonce); maskNonce(nonceBuffer, nonceMask, nonce); aeadCrypter.encrypt(ciphertext, plaintext, nonceBuffer); } AesGcmHkdfAeadCrypter(byte[] key); @Override void encrypt(ByteBuffer ciphertext, ByteBuffer plaintext, byte[] nonce); @Override void encrypt(ByteBuffer ciphertext, ByteBuffer plaintext, ByteBuffer aad, byte[] nonce); @Override void decrypt(ByteBuffer plaintext, ByteBuffer ciphertext, byte[] nonce); @Override void decrypt(ByteBuffer plaintext, ByteBuffer ciphertext, ByteBuffer aad, byte[] nonce);  }### Answer:
@Test public void testVectorEncrypt() throws GeneralSecurityException { int i = 0; for (TestVector testVector : testVectors) { int bufferSize = testVector.ciphertext.length; byte[] ciphertext = new byte[bufferSize]; ByteBuffer ciphertextBuffer = ByteBuffer.wrap(ciphertext); AesGcmHkdfAeadCrypter aeadCrypter = new AesGcmHkdfAeadCrypter(testVector.key); aeadCrypter.encrypt( ciphertextBuffer, ByteBuffer.wrap(testVector.plaintext), ByteBuffer.wrap(testVector.aad), testVector.nonce); String msg = "Failure for test vector " + i; assertWithMessage(msg) .that(ciphertextBuffer.remaining()) .isEqualTo(bufferSize - testVector.ciphertext.length); byte[] exactCiphertext = Arrays.copyOf(ciphertext, testVector.ciphertext.length); assertWithMessage(msg).that(exactCiphertext).isEqualTo(testVector.ciphertext); i++; } }