Initialize ShadowSystemClock.bootedAt to 0, rather than Robolectric.getUiThreadScheduler().getCurrentTime(). Otherwise, the value assigned to bootedAt will depend on when ShadowSystemClock happens to get loaded by the classloader, which may be at a time when getUiThreadScheduler().getCurrentTime() has already been advanced, which causes SystemClock.uptimeMillis() to report a time less than getuiThreadScheduler().getCurrentTime().