### Question:
SslContextFactory { public SSLContext getServerContext() { String algorithm = Security .getProperty("ssl.KeyManagerFactory.algorithm"); if (algorithm == null) { algorithm = "SunX509"; } SSLContext serverContext = null; try { KeyStore ks = KeyStore.getInstance(tlsConfig.getTlsKeystoreType().name()); ks.load(SslKeyStore.asInputStream(tlsConfig.getTlsKeystore(), tlsConfig.getTlsKeystorePathType()), tlsConfig.getKeystorePassword().toCharArray()); KeyManagerFactory kmf = KeyManagerFactory.getInstance(algorithm); kmf.init(ks, tlsConfig.getCertificatePassword().toCharArray()); KeyStore ts = KeyStore.getInstance(tlsConfig.getTlsTruststoreType().name()); ts.load(SslKeyStore.asInputStream(tlsConfig.getTlsTruststore(), tlsConfig.getTlsTruststorePathType()), tlsConfig.getTruststorePassword().toCharArray()); TrustManagerFactory tmf = TrustManagerFactory.getInstance(algorithm); tmf.init(ts); serverContext = SSLContext.getInstance(PROTOCOL); serverContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); } catch (IOException e) { LOG.warn("IOException - Failed to load keystore / truststore." + " Failed to initialize the server-side SSLContext", e); } catch (NoSuchAlgorithmException e) { LOG.warn("NoSuchAlgorithmException - Unsupported algorithm." + " Failed to initialize the server-side SSLContext", e); } catch (CertificateException e) { LOG.warn("CertificateException - Unable to access certificate (check password)." + " Failed to initialize the server-side SSLContext", e); } catch (Exception e) { LOG.warn("Exception - Failed to initialize the server-side SSLContext", e); } return serverContext; } SslContextFactory(TlsConfiguration tlsConfig); SSLContext getServerContext();  }### Answer:
@Test public void testGetServerContext() throws Exception { SSLContext context = sslContextFactory.getServerContext() ; assertNotNull( context ); }