DockerClientConfig implements Serializable { public DockerClientConfig connectionPoolSize(int connectionPoolSize) { if (connectionPoolSize < 1) { throw new IllegalArgumentException("Invalid thread pool size: " + connectionPoolSize); } this.connectionPoolSize = connectionPoolSize; return this; } DockerClientConfig(@Nonnull URI instanceURI, DockerAPIVersion apiVersion); DockerClientConfig usingTls(boolean usingTls); DockerClientConfig verifyingHostname(boolean verifyingHostname); DockerClientConfig connectionPoolSize(int connectionPoolSize); DockerClientConfig connectTimeout(Duration connectTimeout); DockerClientConfig transferTimeout(Duration transferTimeout); @Nonnull URI getInstanceURI(); boolean isVerifyingHostname(); boolean isUsingTLS(); int getConnectionPoolSize(); @Nonnull DockerAPIVersion getApiVersion(); Duration getConnectTimeout(); Duration getTransferTimeout();  }
@Test public void invalidConnectionPoolSize() { DockerClientConfig config = new DockerClientConfig(DockerCloudUtils.DOCKER_DEFAULT_SOCKET_URI, DockerAPIVersion.DEFAULT); assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> config.connectionPoolSize(0)); assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> config.connectionPoolSize(-1)); }