title: What is the Java equivalent of Golang's WaitGroup
body: <p>Golang has something called a <code>WaitGroup</code> which is sort of like in Java a <code>CompletionService</code> or a <code>CountDownLatch</code> or a <code>Semaphore</code> or some combination of the latter.</p>
  
  <p>I'm not entirely sure how you would implement a WaitGroup in Java. I would imagine a custom CompletionService with some sort of Poison message would be the route to go (since queues can't say when they are done) but perhaps there is a better concurrent data structure/lock?</p>
  
  <p>EDIT I posted a possible solution below using <code>Semaphore</code> that I think is more analogous than using <code>thread.join</code>.</p>