### Question:
SSLContextFactory { @VisibleForTesting static KeyStore loadPKCS12KeyStore(InputStream pkcs12Stream, char[] pkcs12Password) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException { KeyStore keyStore = KeyStore.getInstance("PKCS12"); keyStore.load(pkcs12Stream, pkcs12Password); return keyStore; }  static SSLContext create(InputStream pkcs12Stream, char[] pkcs12Password); static final SSLContext TRUST_ALL; }### Answer:
@Test public void testKeyStoreIsPKCS12() throws Exception { InputStream pkcs12Stream = ClassLoader.getSystemClassLoader().getResourceAsStream("pkcs_pwd_toto.p12"); char[] pkcs12Password = "toto".toCharArray(); KeyStore keyStore = SSLContextFactory.loadPKCS12KeyStore(pkcs12Stream, pkcs12Password); InputStream pkcs12InnerX509 = ClassLoader.getSystemClassLoader().getResourceAsStream("pkcs_inner_x509.crt"); Certificate pkcs12InnerCertificate = CertificateFactory.getInstance("x509").generateCertificate(pkcs12InnerX509); assertThat(keyStore.getType()).isEqualToIgnoringCase("pkcs12"); assertThat(keyStore.getCertificate("client2")).isEqualTo(pkcs12InnerCertificate); }