@Test
  public void createKeyTemplate_aesGcm_works() throws Exception {
    LegacyKmsEnvelopeAeadParameters parameters =
        LegacyKmsEnvelopeAeadParameters.builder()
            .setKekUri("SomeMatchingKekUri")
            .setDekParsingStrategy(
                LegacyKmsEnvelopeAeadParameters.DekParsingStrategy.ASSUME_AES_GCM)
            .setDekParametersForNewKeys(
                AesGcmParameters.builder()
                    .setIvSizeBytes(12)
                    .setKeySizeBytes(16)
                    .setTagSizeBytes(16)
                    .setVariant(AesGcmParameters.Variant.NO_PREFIX)
                    .build())
            .build();

    // Check with both NO_PREFIX as well as TINK to ensure the Variant is ignored.
    KeyTemplate template1 =
        KmsEnvelopeAeadKeyManager.createKeyTemplate(
            "SomeMatchingKekUri", KeyTemplates.get("AES128_GCM"));
    assertThat(template1.toParameters()).isEqualTo(parameters);

    KeyTemplate template2 =
        KmsEnvelopeAeadKeyManager.createKeyTemplate(
            "SomeMatchingKekUri", KeyTemplates.get("AES128_GCM_RAW"));
    assertThat(template2.toParameters()).isEqualTo(parameters);
  }
Tests for {@code KmsEnvelopeAead} and {@code KmsEnvelopeAeadKeyManager}.
java_src/src/test/java/com/google/crypto/tink/aead/KmsEnvelopeAeadKeyManagerTest.java