@Test
  public void parseKey_ignoreOutputPrefixType_legacy() throws Exception {
    AesGcmHkdfStreamingParameters parameters =
        AesGcmHkdfStreamingParameters.builder()
            .setKeySizeBytes(37)
            .setDerivedAesGcmKeySizeBytes(16)
            .setHkdfHashType(AesGcmHkdfStreamingParameters.HashType.SHA512)
            .setCiphertextSegmentSizeBytes(1024 * 1024)
            .build();

    AesGcmHkdfStreamingKey key = AesGcmHkdfStreamingKey.create(parameters, KEY_BYTES_37);

    com.google.crypto.tink.proto.AesGcmHkdfStreamingKey protoKey =
        com.google.crypto.tink.proto.AesGcmHkdfStreamingKey.newBuilder()
            .setVersion(0)
            .setKeyValue(KEY_BYTES_37_AS_BYTE_STRING)
            .setParams(
                com.google.crypto.tink.proto.AesGcmHkdfStreamingParams.newBuilder()
                    .setHkdfHashType(HashType.SHA512)
                    .setDerivedKeySize(16)
                    .setCiphertextSegmentSize(1024 * 1024))
            .build();

    ProtoKeySerialization serialization =
        ProtoKeySerialization.create(
            "type.googleapis.com/google.crypto.tink.AesGcmHkdfStreamingKey",
            protoKey.toByteString(),
            KeyMaterialType.SYMMETRIC,
            OutputPrefixType.LEGACY,
            123);

    Key parsed = registry.parseKey(serialization, InsecureSecretKeyAccess.get());
    assertThat(parsed.equalsKey(key)).isTrue();
  }
Test that if "OutputPrefixType" is set to CRUNCHY, we just ignore it.
java_src/src/test/java/com/google/crypto/tink/streamingaead/internal/AesGcmHkdfStreamingProtoSerializationTest.java