private void test_Cipher_init_NullParameters(Cipher c, int encryptMode, Key encryptKey)
            throws Exception {
        try {
            c.init(encryptMode, encryptKey, (AlgorithmParameterSpec) null);
        } catch (InvalidAlgorithmParameterException e) {
            if (!isPBE(c.getAlgorithm())) {
                throw e;
            }
        }

        try {
            c.init(encryptMode, encryptKey, (AlgorithmParameterSpec) null, null);
        } catch (InvalidAlgorithmParameterException e) {
            if (!isPBE(c.getAlgorithm())) {
                throw e;
            }
        }

        try {
            c.init(encryptMode, encryptKey, (AlgorithmParameters) null);
        } catch (InvalidAlgorithmParameterException e) {
            if (!isPBE(c.getAlgorithm())) {
                throw e;
            }
        }

        try {
            c.init(encryptMode, encryptKey, (AlgorithmParameters) null, null);
        } catch (InvalidAlgorithmParameterException e) {
            if (!isPBE(c.getAlgorithm())) {
                throw e;
            }
        }
    }
Try various .init(...) calls with null parameters to make sure it is
handled.
common/src/test/java/org/conscrypt/javax/crypto/CipherTest.java