@UnstableAPI
    protected boolean test() {
        TransportConfig transportConfig = getTransportConfig();
        URI dockerHost = transportConfig.getDockerHost();

        Callable<Socket> socketProvider;
        SocketAddress socketAddress;
        switch (dockerHost.getScheme()) {
            case "tcp":
            case "http":
            case "https":
                SocketFactory socketFactory = SocketFactory.getDefault();
                SSLConfig sslConfig = transportConfig.getSslConfig();
                if (sslConfig != null) {
                    try {
                        socketFactory = sslConfig.getSSLContext().getSocketFactory();
                    } catch (
                        KeyManagementException
                        | UnrecoverableKeyException
                        | NoSuchAlgorithmException
                        | KeyStoreException e
                    ) {
                        log.warn("Exception while creating SSLSocketFactory", e);
                        return false;
                    }
                }
                socketProvider = socketFactory::createSocket;
                socketAddress = new InetSocketAddress(dockerHost.getHost(), dockerHost.getPort());
                break;
            case "unix":
            case "npipe":
                if (!new File(dockerHost.getPath()).exists()) {
                    log.debug("DOCKER_HOST socket file '{}' does not exist", dockerHost.getPath());
                    return false;
                }
                socketProvider =
                    () -> {
                        switch (dockerHost.getScheme()) {
                            case "unix":
                                return UnixSocket.get(dockerHost.getPath());
                            case "npipe":
                                return new NamedPipeSocket(dockerHost.getPath());
                            default:
                                throw new IllegalStateException("Unexpected scheme " + dockerHost.getScheme());
                        }
                    };
                socketAddress = new InetSocketAddress("localhost", 2375);
                break;
            default:
                log.warn("Unknown DOCKER_HOST scheme {}, skipping the strategy test...", dockerHost.getScheme());
                return true;
        }

        try (Socket socket = socketProvider.call()) {
            Awaitility
                .await()
                .atMost(TestcontainersConfiguration.getInstance().getClientPingTimeout(), TimeUnit.SECONDS) // timeout after configured duration
                .pollInterval(Duration.ofMillis(200)) // check state every 200ms
                .pollDelay(Duration.ofSeconds(0)) // start checking immediately
                .untilAsserted(() -> socket.connect(socketAddress));
            return true;
        } catch (Exception e) {
            log.warn("DOCKER_HOST {} is not listening", dockerHost, e);
            return false;
        }
    }
TODO we should consider moving this to docker-java at some point
core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java