FixedTweetTimeline extends BaseTimeline implements Timeline<Tweet> { @Override public void previous(Long maxPosition, Callback<TimelineResult<Tweet>> cb) { final List<Tweet> empty = Collections.emptyList(); final TimelineResult<Tweet> timelineResult = new TimelineResult<>(new TimelineCursor(empty), empty); cb.success(new Result(timelineResult, null)); } FixedTweetTimeline(List<Tweet> tweets); @Override void next(Long minPosition, Callback<TimelineResult<Tweet>> cb); @Override void previous(Long maxPosition, Callback<TimelineResult<Tweet>> cb);  }
@Test public void testNext_succeedsWithEmptyTweets() { final FixedTweetTimeline timeline = new FixedTweetTimeline(fixedTweets); timeline.previous(ANY_ID, new Callback<TimelineResult<Tweet>>() { @Override public void success(Result<TimelineResult<Tweet>> result) { assertTrue(result.data.items.isEmpty()); assertNull(result.data.timelineCursor.maxPosition); assertNull(result.data.timelineCursor.minPosition); assertNull(result.response); } @Override public void failure(TwitterException exception) { fail("Expected FixedTweetTimeline previous to always succeed."); } }); }