TimelineStateHolder { public void setNextCursor(TimelineCursor timelineCursor) { nextCursor = timelineCursor; setCursorsIfNull(timelineCursor); } TimelineStateHolder();   TimelineStateHolder(TimelineCursor nextCursor, TimelineCursor previousCursor); void resetCursors(); Long positionForNext(); Long positionForPrevious(); void setNextCursor(TimelineCursor timelineCursor); void setPreviousCursor(TimelineCursor timelineCursor); void setCursorsIfNull(TimelineCursor timelineCursor); boolean startTimelineRequest(); void finishTimelineRequest(); final AtomicBoolean requestInFlight; }
@Test public void testSetNextCursor() { final TimelineCursor previousCursor = new TimelineCursor(ANY_POSITION, ANY_POSITION); final TimelineStateHolder holder = new TimelineStateHolder( new TimelineCursor(ANY_POSITION, ANY_POSITION), previousCursor); holder.setNextCursor(TEST_TIMELINE_CURSOR); assertEquals(TEST_TIMELINE_CURSOR, holder.nextCursor); assertEquals(previousCursor, holder.previousCursor); }
@Test public void testSetNextCursor_firstLoad() { final TimelineStateHolder holder = new TimelineStateHolder(); holder.setNextCursor(TEST_TIMELINE_CURSOR); assertEquals(TEST_TIMELINE_CURSOR, holder.nextCursor); assertEquals(TEST_TIMELINE_CURSOR, holder.previousCursor); }