class ForexNonDeliverableForwardDiscountingMethod {

  public MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final ForexNonDeliverableForward ndf, final MulticurveProviderInterface multicurves) {
    ArgumentChecker.notNull(ndf, "Non deliverable forward");
    ArgumentChecker.notNull(multicurves, "Multi-curves provider");
    final double df2 = multicurves.getDiscountFactor(ndf.getCurrency2(), ndf.getPaymentTime());
    final double df1 = multicurves.getDiscountFactor(ndf.getCurrency1(), ndf.getPaymentTime());
    final double spot = multicurves.getFxRate(ndf.getCurrency2(), ndf.getCurrency1());
    // Backward sweep
    final double pvBar = 1.0;
    final double df1Bar = -ndf.getNotionalCurrency2() * ndf.getExchangeRate() / spot * pvBar;
    final double df2Bar = ndf.getNotionalCurrency2() * pvBar;
    final Map<String, List<DoublesPair>> resultMap = new HashMap<>();
    final List<DoublesPair> listDiscounting1 = new ArrayList<>();
    listDiscounting1.add(DoublesPair.of(ndf.getPaymentTime(), -ndf.getPaymentTime() * df1 * df1Bar));
    resultMap.put(multicurves.getName(ndf.getCurrency1()), listDiscounting1);
    final List<DoublesPair> listDiscounting2 = new ArrayList<>();
    listDiscounting2.add(DoublesPair.of(ndf.getPaymentTime(), -ndf.getPaymentTime() * df2 * df2Bar));
    resultMap.put(multicurves.getName(ndf.getCurrency2()), listDiscounting2);
    final MulticurveSensitivity result = MulticurveSensitivity.ofYieldDiscounting(resultMap);
    return MultipleCurrencyMulticurveSensitivity.of(ndf.getCurrency2(), result);
  }

  private  ForexNonDeliverableForwardDiscountingMethod();

}