ForexNonDeliverableForwardDiscountingMethod { public double forwardForexRate(final ForexNonDeliverableForward ndf, final MulticurveProviderInterface multicurves) { ArgumentChecker.notNull(ndf, "Non deliverable forward"); ArgumentChecker.notNull(multicurves, "Multi-curves provider"); final double dfDelivery = multicurves.getDiscountFactor(ndf.getCurrency2(), ndf.getPaymentTime()); final double dfNonDelivery = multicurves.getDiscountFactor(ndf.getCurrency1(), ndf.getPaymentTime()); final double spot = multicurves.getFxRate(ndf.getCurrency2(), ndf.getCurrency1()); return spot * dfDelivery / dfNonDelivery; } private  ForexNonDeliverableForwardDiscountingMethod(); static ForexNonDeliverableForwardDiscountingMethod getInstance(); MultipleCurrencyAmount presentValue(final ForexNonDeliverableForward ndf, final MulticurveProviderInterface multicurves); MultipleCurrencyAmount currencyExposure(final ForexNonDeliverableForward ndf, final MulticurveProviderInterface multicurves); double forwardForexRate(final ForexNonDeliverableForward ndf, final MulticurveProviderInterface multicurves); MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final ForexNonDeliverableForward ndf, final MulticurveProviderInterface multicurves);  }
@Test public void forwardRateVsForex() { final double fwdNDF = METHOD_NDF.forwardForexRate(NDF, MULTICURVES); final double fwdFX = METHOD_FX.forwardForexRate(FOREX, MULTICURVES); assertEquals("Forward rate - non-deliverable forward", fwdNDF, fwdFX, TOLERANCE_PV); }