PatientDataService { public List<StockCard> getMalariaProductsStockCards() { List<StockCard> malariaProductsStockCards = new ArrayList<>(); List<Product> malariaProducts = getMalariaProducts(); try { for (Product malariaProduct : malariaProducts) { StockCard stockCard = stockRepository.queryStockCardByProductCode(malariaProduct.getCode()); malariaProductsStockCards.add(stockCard); } } catch (LMISException e) { e.printStackTrace(); } return malariaProductsStockCards; }  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 shouldReturnExistingStockCardOfMalariaProducts() throws Exception { List<StockCard> expectedMalariaStockCards = newArrayList(stockCard6x1, stockCard6x2, stockCard6x3, stockCard6x4); List<StockCard> stocks = patientDataService.getMalariaProductsStockCards(); assertThat(stocks.size(), is(expectedMalariaStockCards.size())); for (StockCard expectedStockCard : expectedMalariaStockCards) { assertTrue(stocks.contains(expectedStockCard)); } }