ArgumentChecker.notNull(black, "Black provider");
final MulticurveProviderInterface multicurve = black.getMulticurveProvider();
final EuropeanVanillaOption option = new EuropeanVanillaOption(cap.getStrike(), cap.getFixingTime(), cap.isCap());
final double forward = multicurve.getForwardRate(cap.getIndex(), cap.getFixingPeriodStartTime(), cap.getFixingPeriodEndTime(), cap.getFixingAccrualFactor());
final double df = multicurve.getDiscountFactor(cap.getCurrency(), cap.getPaymentTime());
final MulticurveSensitivity forwardDr = MulticurveSensitivity.ofForward(multicurve.getName(cap.getIndex()),
new ForwardSensitivity(cap.getFixingPeriodStartTime(), cap.getFixingPeriodEndTime(), cap.getFixingAccrualFactor(), 1.0));
final double dfDr = -cap.getPaymentTime() * df;
final double volatility = black.getBlackParameters().getVolatility(cap.getFixingTime(), cap.getStrike());
final BlackFunctionData dataBlack = new BlackFunctionData(forward, 1.0, volatility);
final double[] bsAdjoint = BLACK_FUNCTION.getPriceAdjoint(option, dataBlack);
final List<DoublesPair> list = new ArrayList<>();
list.add(new DoublesPair(cap.getPaymentTime(), dfDr));
final Map<String, List<DoublesPair>> resultMap = new HashMap<>();
resultMap.put(multicurve.getName(cap.getCurrency()), list);
MulticurveSensitivity result = MulticurveSensitivity.ofYieldDiscounting(resultMap);
result = result.multipliedBy(bsAdjoint[0]);
result = result.plus(forwardDr.multipliedBy(df * bsAdjoint[1]));
result = result.multipliedBy(cap.getNotional() * cap.getPaymentYearFraction());
return MultipleCurrencyMulticurveSensitivity.of(cap.getCurrency(), result);
}