Fixed missing doc comment
Replaced sleeping loops for waiting with CountDownLatch.await calls