private void testAES_ECB_NoPadding_IvParameters_Failure(String provider) throws Exception {
        String algorithm = "AES/ECB/NoPadding";
        if (!isSupported(algorithm, provider)) {
            return;
        }
        Cipher c = Cipher.getInstance(algorithm, provider);

        AlgorithmParameterSpec spec = new IvParameterSpec(AES_IV_ZEROES);
        try {
            c.init(Cipher.ENCRYPT_MODE, AES_128_KEY, spec);
            fail("Should not accept an IV in ECB mode; provider=" + provider);
        } catch (InvalidAlgorithmParameterException expected) {
        }
    }
Helper for testing that Cipher.unwrap() throws IllegalStateException when
initialized in modes other than UNWRAP.
common/src/test/java/org/conscrypt/javax/crypto/CipherTest.java