### Question:
DiscountingOvernightFutureTradePricer { CurrencyAmount presentValue(ResolvedOvernightFutureTrade trade, double currentPrice, double referencePrice) { ResolvedOvernightFuture future = trade.getProduct(); double priceIndex = productPricer.marginIndex(future, currentPrice); double referenceIndex = productPricer.marginIndex(future, referencePrice); double pv = (priceIndex - referenceIndex) * trade.getQuantity(); return CurrencyAmount.of(future.getCurrency(), pv); } 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_presentValue() { double currentPrice = 0.995; double referencePrice = 0.9925; double currentPriceIndex = PRICER_PRODUCT.marginIndex(RESOLVED_TRADE.getProduct(), currentPrice); double referencePriceIndex = PRICER_PRODUCT.marginIndex(RESOLVED_TRADE.getProduct(), referencePrice); double presentValueExpected = (currentPriceIndex - referencePriceIndex) * RESOLVED_TRADE.getQuantity(); CurrencyAmount presentValueComputed = PRICER_TRADE.presentValue(RESOLVED_TRADE, currentPrice, referencePrice); assertThat(presentValueComputed.getAmount()).isCloseTo(presentValueExpected, offset(TOLERANCE_PV)); }