@Test public void fetchItems() { itemProvider.addItems( FIRST_ITEM, SECOND_ITEM, THIRD_ITEM, FOURTH_ITEM, FIFTH_ITEM, SIXTH_ITEM ); timeline.setFetchCount( 2 ); timeline.fetchItems(); timeline.fetchItems(); List<Item> actual = timeline.getItems(); assertArrayEquals( new Item[] { SIXTH_ITEM, FIFTH_ITEM, FOURTH_ITEM, THIRD_ITEM }, actual.toArray( new Item[ 2 ] ) ); }
public void fetchItems() { int restoreOffset = restoreIfNeeded(); items.addAll( itemProvider.fetchItems( getOldest(), getFetchCount() + restoreOffset ) ); sessionStorage.storeTop( getTopItem() ); }
Timeline { public void fetchItems() { int restoreOffset = restoreIfNeeded(); items.addAll( itemProvider.fetchItems( getOldest(), getFetchCount() + restoreOffset ) ); sessionStorage.storeTop( getTopItem() ); } }
Timeline { public void fetchItems() { int restoreOffset = restoreIfNeeded(); items.addAll( itemProvider.fetchItems( getOldest(), getFetchCount() + restoreOffset ) ); sessionStorage.storeTop( getTopItem() ); } Timeline( ItemProvider itemProvider );  Timeline( ItemProvider itemProvider, SessionStorage sessionStorage  ); }
Timeline { public void fetchItems() { int restoreOffset = restoreIfNeeded(); items.addAll( itemProvider.fetchItems( getOldest(), getFetchCount() + restoreOffset ) ); sessionStorage.storeTop( getTopItem() ); } Timeline( ItemProvider itemProvider );  Timeline( ItemProvider itemProvider, SessionStorage sessionStorage  ); void setFetchCount( int fetchCount ); int getFetchCount(); List<Item> getItems(); void fetchItems(); }
Timeline { public void fetchItems() { int restoreOffset = restoreIfNeeded(); items.addAll( itemProvider.fetchItems( getOldest(), getFetchCount() + restoreOffset ) ); sessionStorage.storeTop( getTopItem() ); } Timeline( ItemProvider itemProvider );  Timeline( ItemProvider itemProvider, SessionStorage sessionStorage  ); void setFetchCount( int fetchCount ); int getFetchCount(); List<Item> getItems(); void fetchItems(); static final int FETCH_COUNT_LOWER_BOUND; static final int FETCH_COUNT_UPPER_BOUND; }