TimelineDelegate { boolean isLastPosition(int position) { return position == (itemList.size() - 1); } TimelineDelegate(Timeline<T> timeline);   TimelineDelegate(Timeline<T> timeline, DataSetObservable observable, List<T> items); void refresh(Callback<TimelineResult<T>> developerCb); void next(Callback<TimelineResult<T>> developerCb); void previous(); int getCount(); Timeline getTimeline(); T getItem(int position); long getItemId(int position); void setItemById(T item); void registerDataSetObserver(DataSetObserver observer); void unregisterDataSetObserver(DataSetObserver observer); void notifyDataSetChanged(); void notifyDataSetInvalidated();  }
@Test public void testIsLastPosition() { testItems = new ArrayList<>(); TestItem.populateList(testItems, NUM_ITEMS); delegate = new TimelineDelegate<>(mockTimeline, mockObservable, testItems); assertFalse(delegate.isLastPosition(0)); assertFalse(delegate.isLastPosition(NUM_ITEMS - 2)); assertTrue(delegate.isLastPosition(NUM_ITEMS - 1)); }