InterestRateFutureSecurityDiscountingMethod extends FuturesSecurityMulticurveMethod { public double parRate(final InterestRateFutureSecurity futures, final MulticurveProviderInterface multicurves) { ArgumentChecker.notNull(futures, "Futures"); ArgumentChecker.notNull(multicurves, "Multi-curves provider"); return multicurves.getSimplyCompoundForwardRate(futures.getIborIndex(), futures.getFixingPeriodStartTime(), futures.getFixingPeriodEndTime(), futures.getFixingPeriodAccrualFactor()); } private  InterestRateFutureSecurityDiscountingMethod(); static InterestRateFutureSecurityDiscountingMethod getInstance(); double parRate(final InterestRateFutureSecurity futures, final MulticurveProviderInterface multicurves);  }
@Test public void parRate() { final double rate = METHOD_IRFUT_SEC_DSC.parRate(ERU2, MULTICURVES); final double expectedRate = MULTICURVES.getSimplyCompoundForwardRate(EURIBOR3M, FIXING_START_TIME, FIXING_END_TIME, FIXING_ACCRUAL); assertEquals("Future price from curves", expectedRate, rate, TOLERANCE_PRICE); }
@Test public void parRateMethodVsCalculator() { final double rateMethod = METHOD_IRFUT_SEC_DSC.parRate(ERU2, MULTICURVES); final double rateCalculator = ERU2.accept(PRDC, MULTICURVES); assertEquals("Future price from curves", rateMethod, rateCalculator, TOLERANCE_PRICE); }