@Override
  public byte[] encrypt(byte[] plaintext, byte[] associatedData) throws GeneralSecurityException {
    if (identifier.length == 0) {
      return rawAead.encrypt(plaintext, associatedData);
    }
    return Bytes.concat(identifier, rawAead.encrypt(plaintext, associatedData));
  }
This method covers the cases where users created their own aead/key classes.
java_src/src/main/java/com/google/crypto/tink/aead/internal/LegacyFullAead.java