PatientDataService { public List<Long> getMalariaProductsStockHand() { List<StockCard> malariaProductsStockCard = getMalariaProductsStockCards(); List<Long> stocks = new ArrayList<>(); for (StockCard stock : malariaProductsStockCard) { if (stock != null) { stocks.add(stock.getStockOnHand()); } else { stocks.add(NO_STOCK_ON_HAND_VALUE); } } return stocks; }  List<Period> calculatePeriods(VIAReportType VIAReportType); List<StockCard> getMalariaProductsStockCards(); List<Long> getMalariaProductsStockHand(); Optional<MalariaProgram> save(MalariaProgram malariaProgram); MalariaProgram findForPeriod(DateTime beginDate, DateTime endDate); List<Product> getMalariaProducts();  }
@Test public void shouldReturnStockCardValuesForAllMalariaProducts() throws Exception { List<Long> stockValues = patientDataService.getMalariaProductsStockHand(); for (Long stockValue : stockValues) { assertThat(stockValue, is(STOCK_ON_HAND_VALUE)); } }