DockerClientBuilder { @Deprecated public static DockerCmdExecFactory getDefaultDockerCmdExecFactory() { return new JerseyDockerCmdExecFactory(); } private  DockerClientBuilder(DockerClientConfig dockerClientConfig); static DockerClientBuilder getInstance(); @Deprecated static DockerClientBuilder getInstance(DefaultDockerClientConfig.Builder dockerClientConfigBuilder); static DockerClientBuilder getInstance(DockerClientConfig dockerClientConfig); @Deprecated static DockerClientBuilder getInstance(String serverUrl); @Deprecated static DockerCmdExecFactory getDefaultDockerCmdExecFactory(); @Deprecated DockerClientBuilder withDockerCmdExecFactory(DockerCmdExecFactory dockerCmdExecFactory); DockerClientBuilder withDockerHttpClient(DockerHttpClient dockerHttpClient); DockerClient build();  }
@Test public void testConcurrentClientBuilding() throws Exception { final Set<DockerCmdExecFactory> instances = Collections.synchronizedSet(new HashSet<>()); Runnable runnable = () -> { DockerCmdExecFactory factory = DockerClientBuilder.getDefaultDockerCmdExecFactory(); assertNotNull(factory); assertFalse(instances.contains(factory)); instances.add(factory); }; parallel(AMOUNT, runnable); assertEquals(instances.size(), AMOUNT); }