summaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/src/test/java/tests/http/MockWebServer.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/support/src/test/java/tests/http/MockWebServer.java b/support/src/test/java/tests/http/MockWebServer.java
index 0cdd561..2083117 100644
--- a/support/src/test/java/tests/http/MockWebServer.java
+++ b/support/src/test/java/tests/http/MockWebServer.java
@@ -33,11 +33,12 @@ import java.net.URL;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingDeque;
@@ -63,7 +64,7 @@ public final class MockWebServer {
private final BlockingQueue<MockResponse> responseQueue
= new LinkedBlockingDeque<MockResponse>();
private final Set<Socket> openClientSockets
- = Collections.synchronizedSet(new HashSet<Socket>());
+ = Collections.newSetFromMap(new ConcurrentHashMap<Socket, Boolean>());
private boolean singleResponse;
private final AtomicInteger requestCount = new AtomicInteger();
private int bodyLimit = Integer.MAX_VALUE;