AlarmSentenceFetchScheduler implements SentenceFetchScheduler { @Override public void nextFetchScheduleAt(long time) { LogUtils.v(Constants.TAG, AlarmSentenceFetchScheduler.class.getCanonicalName() + " nextFetchScheduleAt:" + time); mFetchAlarmManager.setNextFetchAlarmAt(time); } @VisibleForTesting  AlarmSentenceFetchScheduler(FetchAlarmManager fetchAlarmManager); static synchronized AlarmSentenceFetchScheduler getInstance(@NonNull FetchAlarmManager fetchAlarmManager); @Override void nextFetchScheduleAt(long time);  }
@Test public void testNextFetchScheduleAt() { long time = System.currentTimeMillis(); mAlarmSentenceFetchScheduler.nextFetchScheduleAt(time); verify(mFetchAlarmManager).setNextFetchAlarmAt(mLongCaptor.capture()); assertEquals(mLongCaptor.getValue(), (Long) time); }