@Before public void setUp() { service = new MockIntentService(); store = new SimpleIntentStore(); cleanup = new IntentCleanup(); idGenerator = new MockIdGenerator(); cleanup.cfgService = new ComponentConfigAdapter(); cleanup.service = service; cleanup.store = store; cleanup.period = 10; cleanup.retryThreshold = 3; cleanup.activate(); assertTrue("store should be empty", Sets.newHashSet(cleanup.store.getIntents()).isEmpty()); Intent.bindIdGenerator(idGenerator); }