class ForexForwardPointsMethod {

  public double[] presentValueForwardPointsSensitivity(final Forex fx, final MulticurveProviderInterface multicurves, final DoublesCurve forwardRates, final Pair<Currency, Currency> ccyPair) {
    final double payTime = fx.getPaymentTime();
    final Currency ccy2;
    final double amount1;
    // Implementation note: The "if" is used to check in which order the fx is given with respect to the order of the forward rates.
    if (checkCurrency(fx, ccyPair)) { // Currency1 of fx is first currency in ccyPair
      ccy2 = fx.getCurrency2();
      amount1 = fx.getPaymentCurrency1().getAmount();
    } else {
      ccy2 = fx.getCurrency1();
      amount1 = fx.getPaymentCurrency2().getAmount();
    }
    final double df2 = multicurves.getDiscountFactor(ccy2, payTime);
    // Backward sweep
    final double pvBar = 1.0;
    final double fwdRateBar = df2 * amount1 * pvBar;
    final Double[] fwdRateDp = forwardRates.getYValueParameterSensitivity(payTime);
    final double[] sensitivity = new double[fwdRateDp.length];
    for (int loops = 0; loops < fwdRateDp.length; loops++) {
      sensitivity[loops] = fwdRateDp[loops] * fwdRateBar;
    }
    return sensitivity;
  }

  private  ForexForwardPointsMethod();

}