### Question:
BlackFxVanillaOptionProductPricer { public double impliedVolatility( ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities) { double timeToExpiry = volatilities.relativeTime(option.getExpiry()); if (timeToExpiry <= 0d) { throw new IllegalArgumentException("valuation is after option's expiry."); } FxRate forward = fxPricer.forwardFxRate(option.getUnderlying(), ratesProvider); CurrencyPair strikePair = option.getUnderlying().getCurrencyPair(); return volatilities.volatility( strikePair, option.getExpiry(), option.getStrike(), forward.fxRate(strikePair)); } BlackFxVanillaOptionProductPricer(
      DiscountingFxSingleProductPricer fxPricer); double price(
      ResolvedFxVanillaOption option,
      RatesProvider ratesProvider,
      BlackFxOptionVolatilities volatilities); CurrencyAmount presentValue(
      ResolvedFxVanillaOption option,
      RatesProvider ratesProvider,
      BlackFxOptionVolatilities volatilities); double delta(
      ResolvedFxVanillaOption option,
      RatesProvider ratesProvider,
      BlackFxOptionVolatilities volatilities); CurrencyAmount presentValueDelta(
      ResolvedFxVanillaOption option,
      RatesProvider ratesProvider,
      BlackFxOptionVolatilities volatilities); PointSensitivities presentValueSensitivityRatesStickyStrike(
      ResolvedFxVanillaOption option,
      RatesProvider ratesProvider,
      BlackFxOptionVolatilities volatilities); double gamma(
      ResolvedFxVanillaOption option,
      RatesProvider ratesProvider,
      BlackFxOptionVolatilities volatilities); CurrencyAmount presentValueGamma(
      ResolvedFxVanillaOption option,
      RatesProvider ratesProvider,
      BlackFxOptionVolatilities volatilities); double vega(
      ResolvedFxVanillaOption option,
      RatesProvider ratesProvider,
      BlackFxOptionVolatilities volatilities); CurrencyAmount presentValueVega(
      ResolvedFxVanillaOption option,
      RatesProvider ratesProvider,
      BlackFxOptionVolatilities volatilities); PointSensitivityBuilder presentValueSensitivityModelParamsVolatility(
      ResolvedFxVanillaOption option,
      RatesProvider ratesProvider,
      BlackFxOptionVolatilities volatilities); double theta(
      ResolvedFxVanillaOption option,
      RatesProvider ratesProvider,
      BlackFxOptionVolatilities volatilities); CurrencyAmount presentValueTheta(
      ResolvedFxVanillaOption option,
      RatesProvider ratesProvider,
      BlackFxOptionVolatilities volatilities); double impliedVolatility(
      ResolvedFxVanillaOption option,
      RatesProvider ratesProvider,
      BlackFxOptionVolatilities volatilities); MultiCurrencyAmount currencyExposure(
      ResolvedFxVanillaOption option,
      RatesProvider ratesProvider,
      BlackFxOptionVolatilities volatilities); static final BlackFxVanillaOptionProductPricer DEFAULT; }### Answer:
@Test public void test_impliedVolatility_atExpiry() { assertThatIllegalArgumentException() .isThrownBy(() -> PRICER.impliedVolatility(CALL_ITM, RATES_PROVIDER_EXPIRY, VOLS_EXPIRY)); }
@Test public void test_impliedVolatility_afterExpiry() { assertThatIllegalArgumentException() .isThrownBy(() -> PRICER.impliedVolatility(CALL_ITM, RATES_PROVIDER_AFTER, VOLS_AFTER)); }