private static AlgorithmParameterSpec modifiedParams(AlgorithmParameterSpec params) {
        if (params instanceof IvParameterSpec) {
            IvParameterSpec ivSpec = (IvParameterSpec) params;
            byte[] iv = ivSpec.getIV();
            iv[0] = (byte) (iv[0] ^ 1);
            return new IvParameterSpec(iv);
        } else if (params instanceof GCMParameterSpec) {
            GCMParameterSpec gcmSpec = (GCMParameterSpec) params;
            byte[] iv = gcmSpec.getIV();
            iv[0] = (byte) (iv[0] ^ 1);
            return new GCMParameterSpec(gcmSpec.getTLen(), iv);
        } else {
            throw new IllegalArgumentException("Unsupported AlgorithmParameterSpec: " + params);
        }
    }
Calls an initialized cipher with different equivalent call patterns.
common/src/test/java/org/conscrypt/javax/crypto/CipherBasicsTest.java