private static Factories newConscryptFactories(boolean useEngineSocket) {
    Provider provider = TestUtils.getConscryptProvider();
    SSLContext clientContext = TestUtils.newClientSslContext(provider);
    SSLContext serverContext = TestUtils.newServerSslContext(provider);
    final SSLSocketFactory clientFactory = clientContext.getSocketFactory();
    final SSLSocketFactory serverFactory = serverContext.getSocketFactory();
    final SSLServerSocketFactory serverSocketFactory = serverContext.getServerSocketFactory();
    TestUtils.setUseEngineSocket(clientFactory, useEngineSocket);
    TestUtils.setUseEngineSocket(serverFactory, useEngineSocket);
    TestUtils.setUseEngineSocket(serverSocketFactory, useEngineSocket);
    return new Factories(clientFactory, serverFactory, serverSocketFactory);
  }
Utility for creating test client and server instances.
benchmark-jmh/src/jmh/java/org/conscrypt/OpenJdkEndpointFactory.java