SSLUtil { @VisibleForTesting protected static SSLContext findSSLContextForProtocols(final String[] protocols, final String[] protocolsForAny) throws NoSuchAlgorithmException { for (String protocol : protocols) { if (protocol.equalsIgnoreCase("any")) { try { return findSSLContextForProtocols(protocolsForAny, new String[0]); } catch (NoSuchAlgorithmException e) { } } try { return SSLContext.getInstance(protocol); } catch (NoSuchAlgorithmException e) { } } throw new NoSuchAlgorithmException(); }  static SSLContext getSSLContextInstance(SSLConfig sslConfig); static String[] readArray(String text); static SSLContext createAndConfigureSSLContext(SSLConfig sslConfig,
      boolean skipSslVerification);  }
@Test public void getARealProtocolAfterProcessingAny() throws Exception { final String[] algorithms = {"dream weaver", "any", "TLSv1.1"}; final String[] algorithmsForAny = new String[] {"sweet dreams (are made of this)"}; final SSLContext sslContextInstance = SSLUtil.findSSLContextForProtocols(algorithms, algorithmsForAny); assertThat(sslContextInstance.getProtocol().equalsIgnoreCase("TLSv1.1")).isTrue(); }