private void testCipher_Success_ForAllSupportingProviders_AtLeastOneProviderRequired(
            List<CipherTestParam> testVectors) throws Exception {
        ByteArrayOutputStream errBuffer = new ByteArrayOutputStream();
        PrintStream out = new PrintStream(errBuffer);
        for (CipherTestParam testVector : testVectors) {
            ArrayList<Provider> providers = new ArrayList<>();

            Provider[] providerArray = Security.getProviders("Cipher." + testVector.transformation);
            if (providerArray != null) {
                Collections.addAll(providers, providerArray);
            }

            if (testVector.transformation.indexOf('/') > 0) {
                Provider[] baseTransformProviderArray = Security.getProviders("Cipher."
                        + testVector.transformation.substring(
                                  0, testVector.transformation.indexOf('/')));
                if (baseTransformProviderArray != null) {
                    Collections.addAll(providers, baseTransformProviderArray);
                }
            }

            if (providers.isEmpty()) {
                out.append("No providers offer " + testVector.transformation + "\n");
                continue;
            }

            for (Provider provider : providers) {
                // Do not test AndroidKeyStore's Signature. It needs an AndroidKeyStore-specific key.
                // It's OKish not to test AndroidKeyStore's Signature here because it's tested
                // by cts/tests/test/keystore.
                if (provider.getName().startsWith("AndroidKeyStore")) {
                    continue;
                }

                // SunMSCAPI seems to have different opinion on what RSA should do compared to other
                // providers. As such it fails many tests, so we will skip it for now.
                if (provider.getName().equals("SunMSCAPI") && testVector.transformation.startsWith("RSA")) {
                    continue;
                }

                try {
                    checkCipher(testVector, provider.getName());
                } catch (Throwable e) {
                    logTestFailure(out, provider.getName(), testVector, e);
                }
            }
        }
        out.flush();
        if (errBuffer.size() > 0) {
            throw new Exception("Errors encountered:\n\n" + errBuffer + "\n\n");
        }
    }
For each test vector in the list, tests that the transformation is supported by at least one
provider and that all implementations of the transformation pass the Known Answer Test (KAT)
as well as other functional tests.
common/src/test/java/org/conscrypt/javax/crypto/CipherTest.java