TimelineStateHolder { public Long positionForPrevious() { return previousCursor == null ? null : previousCursor.minPosition; } 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 testPositionForPrevious() { final TimelineStateHolder holder = new TimelineStateHolder(mockTimelineCursor, new TimelineCursor(TEST_MIN_POSITION, ANY_POSITION)); assertEquals(TEST_MIN_POSITION, holder.positionForPrevious()); }
@Test public void testPositionForPrevious_nullCursor() { final TimelineStateHolder holder = new TimelineStateHolder(mockTimelineCursor, null); assertNull(holder.positionForPrevious()); }