Scroller { protected boolean shouldQueryForMoreData() { int numberOfRecordsSeen = firstVisibleItem + visibleItemThreshold; int recordNumberToTriggerLoad = numberOfItemsInAdapter - numberOfVisibleItems; return recordNumberToTriggerLoad <= numberOfRecordsSeen; } Scroller(); abstract void loadRecordsForNextPage(); void updateRecordNumbers(int firstVisibleItem, int numberOfVisibleItems, int numberOfItemsInAdapter);  }
@Test public void shouldQueryForMoreDataReturnsTrueWhenThereIsNoRecordInListView(){ assertTrue(scroller.shouldQueryForMoreData()); }