### Question:
DiscountingOvernightFutureTradePricer { double referencePrice(ResolvedOvernightFutureTrade trade, LocalDate valuationDate, double lastSettlementPrice) { ArgChecker.notNull(valuationDate, "valuationDate"); return trade.getTradedPrice() .filter(tp -> tp.getTradeDate().equals(valuationDate)) .map(tp -> tp.getPrice()) .orElse(lastSettlementPrice); } DiscountingOvernightFutureTradePricer(
      DiscountingOvernightFutureProductPricer productPricer); double price(ResolvedOvernightFutureTrade trade, RatesProvider ratesProvider); PointSensitivities priceSensitivity(ResolvedOvernightFutureTrade trade, RatesProvider ratesProvider); CurrencyAmount presentValue(
      ResolvedOvernightFutureTrade trade,
      RatesProvider ratesProvider,
      double lastSettlementPrice); PointSensitivities presentValueSensitivity(ResolvedOvernightFutureTrade trade, RatesProvider ratesProvider); double parSpread(ResolvedOvernightFutureTrade trade, RatesProvider ratesProvider, double lastSettlementPrice); PointSensitivities parSpreadSensitivity(ResolvedOvernightFutureTrade trade, RatesProvider ratesProvider); static final DiscountingOvernightFutureTradePricer DEFAULT; }### Answer:
@Test public void test_reference_price_after_trade_date() { LocalDate tradeDate = RESOLVED_TRADE.getTradedPrice().get().getTradeDate(); LocalDate valuationDate = tradeDate.plusDays(1); double settlementPrice = 0.995; double referencePrice = PRICER_TRADE.referencePrice(RESOLVED_TRADE, valuationDate, settlementPrice); assertThat(referencePrice).isEqualTo(settlementPrice); }
@Test public void test_reference_price_on_trade_date() { LocalDate tradeDate = RESOLVED_TRADE.getTradedPrice().get().getTradeDate(); LocalDate valuationDate = tradeDate; double settlementPrice = 0.995; double referencePrice = PRICER_TRADE.referencePrice(RESOLVED_TRADE, valuationDate, settlementPrice); assertThat(referencePrice).isEqualTo(RESOLVED_TRADE.getTradedPrice().get().getPrice()); }