public FacilityProductReportEntry(StockCard stockCard, Date endTime) { if (endTime == null) { endTime = new Date(); } this.productName = stockCard.getProduct().getPrimaryName(); List<StockCardEntry> stockCardEntryList = filterEntryByDate(stockCard, endTime); this.productQuantity = calculateQuantity(stockCardEntryList); assignSoonestExpirationDate(stockCardEntryList); this.code = stockCard.getProduct().getCode(); }