@Test
  public void testEmptyAssociatedData() throws Exception {
    Assume.assumeFalse(TinkFips.useOnlyFips());

    byte[] aad = new byte[0];
    InsecureNonceChaCha20Poly1305 cipher =
        createInstance(Random.randBytes(KEY_SIZE_IN_BYTES));
    byte[] nonce = Random.randBytes(NONCE_SIZE_IN_BYTES);
    for (int messageSize = 0; messageSize < 75; messageSize++) {
      byte[] message = Random.randBytes(messageSize);
      { // encrypting with aad as a 0-length array
        byte[] ciphertext = cipher.encrypt(nonce, message, aad);
        byte[] decrypted = cipher.decrypt(nonce, ciphertext, aad);
        assertArrayEquals(message, decrypted);
        byte[] decrypted2 = cipher.decrypt(nonce, ciphertext, null);
        assertArrayEquals(message, decrypted2);
        byte[] badAad = new byte[] {1, 2, 3};
        assertThrows(
            AEADBadTagException.class,
            () -> {
              byte[] unused = cipher.decrypt(nonce, ciphertext, badAad);
            });
      }
      { // encrypting with aad equal to null
        byte[] ciphertext = cipher.encrypt(nonce, message, null);
        byte[] decrypted = cipher.decrypt(nonce, ciphertext, aad);
        assertArrayEquals(message, decrypted);
        byte[] decrypted2 = cipher.decrypt(nonce, ciphertext, null);
        assertArrayEquals(message, decrypted2);
        byte[] badAad = new byte[] {1, 2, 3};
        assertThrows(
            AEADBadTagException.class,
            () -> {
              byte[] unused = cipher.decrypt(nonce, ciphertext, badAad);
            });
      }
    }
  }
BC had a bug, where GCM failed for messages of size > 8192
java_src/src/test/java/com/google/crypto/tink/aead/internal/InsecureNonceChaCha20Poly1305Test.java