@Test public void shouldFilterViewModels() throws Exception { LMISTestApp.getInstance().setCurrentTimeMillis(DateUtil.parseString("2016-09-01", DateUtil.DB_DATE_FORMAT).getTime()); StockCard stockcard1 = StockCardBuilder.buildStockCard(); StockMovementItem stockMovementItem1 = new StockMovementItem(stockcard1); stockMovementItem1.setMovementDate(DateUtil.parseString("2016-08-26", DateUtil.DB_DATE_FORMAT)); stockMovementItem1.setReason("INVENTORY"); stockcard1.getStockMovementItemsWrapper().add(stockMovementItem1); mPresenter.viewModelList.add(new StockHistoryViewModel(stockcard1)); mPresenter.filterViewModels(7); assertEquals(1, mPresenter.filteredViewModelList.size()); }
protected void filterViewModels(final int days) { filteredViewModelList.clear(); filteredViewModelList.addAll(FluentIterable.from(viewModelList).filter(stockHistoryViewModel -> !stockHistoryViewModel.filter(days).isEmpty()).toList()); }
AllDrugsMovementPresenter extends Presenter { protected void filterViewModels(final int days) { filteredViewModelList.clear(); filteredViewModelList.addAll(FluentIterable.from(viewModelList).filter(stockHistoryViewModel -> !stockHistoryViewModel.filter(days).isEmpty()).toList()); } }
AllDrugsMovementPresenter extends Presenter { protected void filterViewModels(final int days) { filteredViewModelList.clear(); filteredViewModelList.addAll(FluentIterable.from(viewModelList).filter(stockHistoryViewModel -> !stockHistoryViewModel.filter(days).isEmpty()).toList()); }  }
AllDrugsMovementPresenter extends Presenter { protected void filterViewModels(final int days) { filteredViewModelList.clear(); filteredViewModelList.addAll(FluentIterable.from(viewModelList).filter(stockHistoryViewModel -> !stockHistoryViewModel.filter(days).isEmpty()).toList()); }  @Override void attachView(BaseView v); void loadMovementHistory(final int days); }
AllDrugsMovementPresenter extends Presenter { protected void filterViewModels(final int days) { filteredViewModelList.clear(); filteredViewModelList.addAll(FluentIterable.from(viewModelList).filter(stockHistoryViewModel -> !stockHistoryViewModel.filter(days).isEmpty()).toList()); }  @Override void attachView(BaseView v); void loadMovementHistory(final int days);  }