### Question:
NormalIborFutureOptionMarginedProductPricer { public double price( ResolvedIborFutureOption futureOption, RatesProvider ratesProvider, NormalIborFutureOptionVolatilities volatilities) { double futurePrice = futurePrice(futureOption, ratesProvider); return price(futureOption, ratesProvider, volatilities, futurePrice); } NormalIborFutureOptionMarginedProductPricer(
      DiscountingIborFutureProductPricer futurePricer); double price(
      ResolvedIborFutureOption futureOption,
      RatesProvider ratesProvider,
      NormalIborFutureOptionVolatilities volatilities); double price(
      ResolvedIborFutureOption futureOption,
      RatesProvider ratesProvider,
      NormalIborFutureOptionVolatilities volatilities,
      double futurePrice); double deltaStickyStrike(
      ResolvedIborFutureOption futureOption,
      RatesProvider ratesProvider,
      NormalIborFutureOptionVolatilities volatilities); double deltaStickyStrike(
      ResolvedIborFutureOption futureOption,
      RatesProvider ratesProvider,
      NormalIborFutureOptionVolatilities volatilities,
      double futurePrice); PointSensitivities priceSensitivityRatesStickyStrike(
      ResolvedIborFutureOption futureOption,
      RatesProvider ratesProvider,
      NormalIborFutureOptionVolatilities volatilities); PointSensitivities priceSensitivityRatesStickyStrike(
      ResolvedIborFutureOption futureOption,
      RatesProvider ratesProvider,
      NormalIborFutureOptionVolatilities volatilities,
      double futurePrice); IborFutureOptionSensitivity priceSensitivityModelParamsVolatility(
      ResolvedIborFutureOption futureOption,
      RatesProvider ratesProvider,
      NormalIborFutureOptionVolatilities volatilities); IborFutureOptionSensitivity priceSensitivityModelParamsVolatility(
      ResolvedIborFutureOption futureOption,
      RatesProvider ratesProvider,
      NormalIborFutureOptionVolatilities volatilities,
      double futurePrice); static final NormalIborFutureOptionMarginedProductPricer DEFAULT; }### Answer:
@Test public void price_from_future_price() { IborIndexRates mockIbor = mock(IborIndexRates.class); SimpleRatesProvider prov = new SimpleRatesProvider(); prov.setIborRates(mockIbor); when(mockIbor.rate(OPTION.getUnderlyingFuture().getIborRate().getObservation())).thenReturn(RATE); double futurePrice = 0.9875; double strike = OPTION.getStrikePrice(); double timeToExpiry = ACT_365F.relativeYearFraction(VAL_DATE, OPTION.getExpiryDate()); double priceSimpleMoneyness = strike - futurePrice; double normalVol = PARAMETERS_PRICE.zValue(timeToExpiry, priceSimpleMoneyness); EuropeanVanillaOption option = EuropeanVanillaOption.of(strike, timeToExpiry, OPTION.getPutCall()); NormalFunctionData normalPoint = NormalFunctionData.of(futurePrice, 1.0, normalVol); double optionPriceExpected = NORMAL_FUNCTION.getPriceFunction(option).apply(normalPoint); double optionPriceComputed = OPTION_PRICER.price(OPTION, prov, VOL_SIMPLE_MONEY_PRICE, futurePrice); assertThat(optionPriceComputed).isCloseTo(optionPriceExpected, offset(TOLERANCE_PRICE)); }
@Test public void price_from_env() { IborIndexRates mockIbor = mock(IborIndexRates.class); SimpleRatesProvider prov = new SimpleRatesProvider(); prov.setIborRates(mockIbor); when(mockIbor.rate(OPTION.getUnderlyingFuture().getIborRate().getObservation())).thenReturn(RATE); double futurePrice = 1.0 - RATE; double optionPriceExpected = OPTION_PRICER.price(OPTION, prov, VOL_SIMPLE_MONEY_PRICE, futurePrice); double optionPriceComputed = OPTION_PRICER.price(OPTION, prov, VOL_SIMPLE_MONEY_PRICE); assertThat(optionPriceComputed).isCloseTo(optionPriceExpected, offset(TOLERANCE_PRICE)); }