TimelineStateHolder { public Long positionForNext() { return nextCursor == null ? null : nextCursor.maxPosition; } 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 testPositionForNext() { final TimelineStateHolder holder = new TimelineStateHolder(new TimelineCursor(ANY_POSITION, TEST_MAX_POSITION), mockTimelineCursor); assertEquals(TEST_MAX_POSITION, holder.positionForNext()); }
@Test public void testPositionForNext_nullCursor() { final TimelineStateHolder holder = new TimelineStateHolder(null, mockTimelineCursor); assertNull(holder.positionForNext()); }