final MulticurveProviderInterface multicurves = blackMulticurves.getMulticurveProvider();
final double pvbpModified = METHOD_SWAP.presentValueBasisPoint(swaption.getUnderlyingSwap(), dayCountModification, calendar, multicurves);
final double forwardModified = METHOD_SWAP.forwardSwapSpreadModified(swaption.getUnderlyingSwap(), pvbpModified, multicurves);
final double strikeModified = METHOD_SWAP.couponEquivalentSpreadModified(swaption.getUnderlyingSwap(), pvbpModified, multicurves);
final double maturity = swaption.getMaturityTime();
final EuropeanVanillaOption option = new EuropeanVanillaOption(strikeModified, swaption.getTimeToExpiry(), swaption.isCall());
// Implementation note: option required to pass the strike (in case the swap has non-constant coupon).
final BlackPriceFunction blackFunction = new BlackPriceFunction();
final double volatility = blackMulticurves.getBlackParameters().getVolatility(swaption.getTimeToExpiry(), maturity);
final BlackFunctionData dataBlack = new BlackFunctionData(forwardModified, pvbpModified, volatility);
final Function1D<BlackFunctionData, Double> func = blackFunction.getPriceFunction(option);