mozilla-services/android-sync — comment on commit b11b5782f804f996ed30189a60d18a5536f3daeb
File: src/test/java/org/mozilla/android/sync/net/test/TestGlobalSession.java line 304
By rnewman:

You must assume that GlobalSession is going to call you back at some point in the future. Your assertions will not necessarily run after all the work done in start() completes, unless you write your mocks such that that is the case. You haven't overridden start() anywhere in the inheritance chain of MockBackoffGlobalSession, so think what would happen if this were true:

public class GlobalSession {
public void start() {
new Thread(new Runnable() {
Thread.sleep(1000);
// Do actual work.
}).start();
}
}

Your assertions need to live in your callback, not here. This is one reason why I suggest parameterization of your mocks.