StandaloneHelper { static public SSLContext createSSLContext( URI keystoreUri, char[] keystorePassword, URI truststoreUri, char[] truststorePassword) throws Exception { KeyStore keystore = loadKeyStore(keystoreUri, keystorePassword); KeyManager[] keyManagers; KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); keyManagerFactory.init(keystore, keystorePassword); keyManagers = keyManagerFactory.getKeyManagers(); KeyStore truststore = loadKeyStore(truststoreUri, truststorePassword); TrustManager[] trustManagers; TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); trustManagerFactory.init(truststore); trustManagers = trustManagerFactory.getTrustManagers(); SSLContext sslContext; sslContext = SSLContext.getInstance("TLS"); sslContext.init(keyManagers, trustManagers, null); return sslContext; }  static int findAvailablePort(int min, int max); static Class<? extends Standalone> resolveStandaloneClass(); static Standalone create(Class<? extends Standalone> standaloneClass); static InputStream openKeyStoreInput(URI uri); static KeyStore loadKeyStore(URI uri, char[] password); static SSLContext createSSLContext(
            URI keystoreUri, char[] keystorePassword,
            URI truststoreUri, char[] truststorePassword);  }
@Test public void createDevelopmentSSLContext() throws Exception { URI keystoreUri = new URI(Standalone.DEFAULT_DEV_NINJA_SSL_KEYSTORE_URI); char[] keystorePassword = Standalone.DEFAULT_DEV_NINJA_SSL_KEYSTORE_PASSWORD.toCharArray(); URI truststoreUri = new URI(Standalone.DEFAULT_DEV_NINJA_SSL_TRUSTSTORE_URI); char[] truststorePassword = Standalone.DEFAULT_DEV_NINJA_SSL_TRUSTSTORE_PASSWORD.toCharArray(); SSLContext sslContext = StandaloneHelper.createSSLContext(keystoreUri, keystorePassword, truststoreUri, truststorePassword); assertThat(sslContext, is(not(nullValue()))); }