### Question:
BlackBondFutureOptionMarginedTradePricer { public CurrencyAmount presentValue( ResolvedBondFutureOptionTrade trade, LocalDate valuationDate, double currentOptionPrice, double lastOptionSettlementPrice) { ResolvedBondFutureOption option = trade.getProduct(); double referencePrice = referencePrice(trade, valuationDate, lastOptionSettlementPrice); double priceIndex = productPricer.marginIndex(option, currentOptionPrice); double referenceIndex = productPricer.marginIndex(option, referencePrice); double pv = (priceIndex - referenceIndex) * trade.getQuantity(); return CurrencyAmount.of(option.getUnderlyingFuture().getCurrency(), pv); } BlackBondFutureOptionMarginedTradePricer(
      BlackBondFutureOptionMarginedProductPricer productPricer); double price(
      ResolvedBondFutureOptionTrade trade,
      LegalEntityDiscountingProvider discountingProvider,
      BondFutureVolatilities volatilities); CurrencyAmount presentValue(
      ResolvedBondFutureOptionTrade trade,
      LocalDate valuationDate,
      double currentOptionPrice,
      double lastOptionSettlementPrice); CurrencyAmount presentValue(
      ResolvedBondFutureOptionTrade trade,
      LegalEntityDiscountingProvider discountingProvider,
      BondFutureVolatilities volatilities,
      double lastOptionSettlementPrice); CurrencyAmount presentValue(
      ResolvedBondFutureOptionTrade trade,
      LegalEntityDiscountingProvider discountingProvider,
      BlackBondFutureVolatilities volatilities,
      double futurePrice,
      double lastOptionSettlementPrice); PointSensitivities presentValueSensitivityRates(
      ResolvedBondFutureOptionTrade trade,
      LegalEntityDiscountingProvider discountingProvider,
      BondFutureVolatilities volatilities); BondFutureOptionSensitivity presentValueSensitivityModelParamsVolatility(
      ResolvedBondFutureOptionTrade futureOptionTrade,
      LegalEntityDiscountingProvider discountingProvider,
      BlackBondFutureVolatilities volatilities); BondFutureOptionSensitivity presentValueSensitivityModelParamsVolatility(
      ResolvedBondFutureOptionTrade futureOptionTrade,
      LegalEntityDiscountingProvider discountingProvider,
      BlackBondFutureVolatilities volatilities,
      double futurePrice); MultiCurrencyAmount currencyExposure(
      ResolvedBondFutureOptionTrade trade,
      LegalEntityDiscountingProvider discountingProvider,
      BondFutureVolatilities volatilities,
      double lastOptionSettlementPrice); MultiCurrencyAmount currencyExposure(
      ResolvedBondFutureOptionTrade trade,
      LocalDate valuationDate,
      double currentOptionPrice,
      double lastOptionSettlementPrice); static final BlackBondFutureOptionMarginedTradePricer DEFAULT; }### Answer:
@Test public void test_presentValue_from_prices_date() { double currentPrice = 0.0325; double lastClosingPrice = 0.03; LocalDate valuationDate1 = LocalDate.of(2014, 3, 30); CurrencyAmount computed1 = OPTION_TRADE_PRICER.presentValue(OPTION_TRADE, valuationDate1, currentPrice, lastClosingPrice); double expected2 = NOTIONAL * QUANTITY * (currentPrice - lastClosingPrice); assertThat(computed1.getCurrency()).isEqualTo(Currency.EUR); assertThat(computed1.getAmount()).isCloseTo(expected2, offset(TOL * NOTIONAL * QUANTITY)); LocalDate valuationDate2 = LocalDate.of(2014, 3, 31); CurrencyAmount computed2 = OPTION_TRADE_PRICER.presentValue(OPTION_TRADE, valuationDate2, currentPrice, lastClosingPrice); double expected = NOTIONAL * QUANTITY * (currentPrice - OPTION_TRADE.getTradedPrice().get().getPrice()); assertThat(computed2.getCurrency()).isEqualTo(Currency.EUR); assertThat(computed2.getAmount()).isCloseTo(expected, offset(TOL * NOTIONAL * QUANTITY)); }