ForwardRateAgreementDiscountingMethod { public double parSpread(final ForwardRateAgreement fra, final MulticurveProviderInterface multicurve) { ArgumentChecker.notNull(fra, "FRA"); ArgumentChecker.notNull(multicurve, "Multiurves"); final double forward = multicurve.getSimplyCompoundForwardRate(fra.getIndex(), fra.getFixingPeriodStartTime(), fra.getFixingPeriodEndTime(), fra.getFixingYearFraction()); return forward - fra.getRate(); } private  ForwardRateAgreementDiscountingMethod(); static ForwardRateAgreementDiscountingMethod getInstance(); MultipleCurrencyAmount presentValue(final ForwardRateAgreement fra, final MulticurveProviderInterface multicurve); MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final ForwardRateAgreement fra, final MulticurveProviderInterface multicurve); double parRate(final ForwardRateAgreement fra, final MulticurveProviderInterface multicurve); double parSpread(final ForwardRateAgreement fra, final MulticurveProviderInterface multicurve); MulticurveSensitivity parSpreadCurveSensitivity(final ForwardRateAgreement fra, final MulticurveProviderInterface multicurve);  }
@Test public void parSpread() { final double parSpread = FRA_METHOD.parSpread(FRA, MULTICURVE); final ForwardRateAgreementDefinition fra0Definition = new ForwardRateAgreementDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE, ACCRUAL_END_DATE, ACCRUAL_FACTOR_PAYMENT, NOTIONAL, FIXING_DATE, USDLIBOR3M, FRA_RATE + parSpread, CALENDAR); final ForwardRateAgreement fra0 = (ForwardRateAgreement) fra0Definition.toDerivative(REFERENCE_DATE); final MultipleCurrencyAmount pv0 = fra0.accept(PVDC, MULTICURVE); assertEquals("FRA discounting: par spread", pv0.getAmount(CUR), 0, TOLERANCE_PV); }
@Test public void parSpreadMethodVsCalculator() { final double parSpreadMethod = FRA_METHOD.parSpread(FRA, MULTICURVE); final double parSpreadCalculator = FRA.accept(PSMQDC, MULTICURVE); assertEquals("FRA discounting: par spread", parSpreadMethod, parSpreadCalculator, TOLERANCE_RATE); }