final RequestContext context = new RequestContext();
Future<RestResponse> f = client.restRequest(request, context);
Future<RestResponse> f2 = client.restRequest(request, context);
// This will block
RestResponse response = f.get(REQUEST_TIMEOUT, TimeUnit.MILLISECONDS);
assertEquals(response.getStatus(), 200);
response = f2.get(REQUEST_TIMEOUT, TimeUnit.MILLISECONDS);
assertEquals(response.getStatus(), 200);
final Integer iterations = 5;
final CountDownLatch latch = new CountDownLatch(iterations);
//Test that sending multiple requests with the same request context works correctly, without
//modifying the original request context.