How can one test methods that fire asynchronous processes with Junit? One wants to make a test wait for the process to end. It is not exactly an unit test, it is more like an integration test as it involves several classes and not just one.
To test this asynchronous code, one will use a count-down latch. One will also see that a count-down latch is more efficient than a notification.