Relying on sleeps like here is a little bit brittle and it also means this test will take 5 seconds which is along time. What about instead using a synchronization mechanism and create a `BlockingListener` that will just block inside of `onJobEnded` until it's signaled to continue.

Also -