@Test public void fetchNew() { itemProvider.addItems( FIRST_ITEM, SECOND_ITEM ); timeline.fetchItems(); itemProvider.addItems( THIRD_ITEM ); timeline.fetchNew(); List<FakeItem> actual = timeline.getItems(); assertThat( actual ).containsExactly( THIRD_ITEM, SECOND_ITEM, FIRST_ITEM ); assertThat( captureStorageMemento( SECOND_STORAGE_CALL ) ) .isEqualTo( createMemento( SECOND_ITEM, THIRD_ITEM, SECOND_ITEM, FIRST_ITEM ) ); }
public void fetchNew() { addSorted( itemProvider.fetchNew( getLatest() ) ); sessionStorage.store( createMemento() ); }
Timeline { public void fetchNew() { addSorted( itemProvider.fetchNew( getLatest() ) ); sessionStorage.store( createMemento() ); } }
Timeline { public void fetchNew() { addSorted( itemProvider.fetchNew( getLatest() ) ); sessionStorage.store( createMemento() ); } Timeline( ItemProvider<T> itemProvider, SessionStorage<T> sessionStorage ); }
Timeline { public void fetchNew() { addSorted( itemProvider.fetchNew( getLatest() ) ); sessionStorage.store( createMemento() ); } Timeline( ItemProvider<T> itemProvider, SessionStorage<T> sessionStorage ); void setFetchCount( int fetchCount ); int getFetchCount(); Optional<T> getTopItem(); void setTopItem( T topItem ); void fetchItems(); int getNewCount(); void fetchNew(); List<T> getItems(); }
Timeline { public void fetchNew() { addSorted( itemProvider.fetchNew( getLatest() ) ); sessionStorage.store( createMemento() ); } Timeline( ItemProvider<T> itemProvider, SessionStorage<T> sessionStorage ); void setFetchCount( int fetchCount ); int getFetchCount(); Optional<T> getTopItem(); void setTopItem( T topItem ); void fetchItems(); int getNewCount(); void fetchNew(); List<T> getItems(); static final int FETCH_COUNT_LOWER_BOUND; static final int FETCH_COUNT_UPPER_BOUND; static final int DEFAULT_FETCH_COUNT; }