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

    byte[] ikm =
        Hex.decode(
            "000102030405060708090a0b0c0d0e0f00112233445566778899aabbccddeeff"
                + "000102030405060708090a0b0c0d0e0f00112233445566778899aabbccddeeff");
    AesCtrHmacStreaming constructorAead =
        new AesCtrHmacStreaming(
            ikm,
            "HmacSha512",
            /* keySizeInBytes= */ 16,
            "HmacSha1",
            /* tagSizeInBytes= */ 12,
            /* ciphertextSegmentSize= */ 256,
            /* firstSegmentOffset= */ 0);
    AesCtrHmacStreamingParameters params =
        AesCtrHmacStreamingParameters.builder()
            .setKeySizeBytes(ikm.length)
            .setHkdfHashType(HashType.SHA512)
            .setDerivedKeySizeBytes(16)
            .setHmacHashType(HashType.SHA1)
            .setHmacTagSizeBytes(12)
            .setCiphertextSegmentSizeBytes(256)
            .build();
    AesCtrHmacStreamingKey key =
        AesCtrHmacStreamingKey.create(
            params, SecretBytes.copyFrom(ikm, InsecureSecretKeyAccess.get()));
    StreamingAead createMethodAead = AesCtrHmacStreaming.create(key);

    StreamingTestUtil.testEncryptDecryptDifferentInstances(
        constructorAead, createMethodAead, 0, 2049, 1000);
  }
Encrypt some plaintext to a file, then decrypt from the file
java_src/src/test/java/com/google/crypto/tink/subtle/AesCtrHmacStreamingTest.java