@Test
public void testConcurrency(){

    int n = 1000;
    final CountDownLatch latch = new CountDownLatch(n);
    StringHttpClient http = new StringHttpClient(new RandomResponseAndLatencyHttpEngine(1, 30));
    for(int i=0;i<n;i++){
        http.request(Requests
            .get("SOME_URL")
        ).consume(r -> {
            latch.countDown();
        });
    }
    try {
        latch.await(10, TimeUnit.SECONDS);
    } catch (InterruptedException e) {
    }
    assertEquals(0, latch.getCount());
}