public static Registry<ConnectionSocketFactory> getSocketFactoryRegistry() {
    return RegistryBuilder.<ConnectionSocketFactory>create()
        .register(CommonConstants.HTTP_PROTOCOL, PlainConnectionSocketFactory.getSocketFactory())
        .register(CommonConstants.HTTPS_PROTOCOL, TlsUtils.buildConnectionSocketFactory()).build();
  }
@Test
  public void itBuildsCorrectRegistry() {
    Registry<ConnectionSocketFactory> socketFactoryRegistry =
        PoolingHttpClientConnectionManagerHelper.getSocketFactoryRegistry();

    assertNotNull(socketFactoryRegistry.lookup(CommonConstants.HTTP_PROTOCOL));
    assertNotNull(socketFactoryRegistry.lookup(CommonConstants.HTTPS_PROTOCOL));
    assertTrue(socketFactoryRegistry.lookup(CommonConstants.HTTP_PROTOCOL) instanceof PlainConnectionSocketFactory);
    assertTrue(socketFactoryRegistry.lookup(CommonConstants.HTTPS_PROTOCOL) instanceof SSLConnectionSocketFactory);
  }