SwapCleanDiscountingCalculator { public Double parRate(SwapFixedIborDefinition swapDefinition, DayCount fixedLegDayCount, DayCount iborLegDayCount, Calendar calendar, ZonedDateTime valuationDate, ZonedDateTimeDoubleTimeSeries indexTimeSeries, MulticurveProviderDiscount multicurves) { ArgumentChecker.notNull(swapDefinition, "swapDefinition"); ArgumentChecker.notNull(fixedLegDayCount, "fixedLegDayCount"); ArgumentChecker.notNull(iborLegDayCount, "iborLegDayCount"); ArgumentChecker.notNull(calendar, "calendar"); ArgumentChecker.notNull(valuationDate, "valuationDate"); ArgumentChecker.notNull(indexTimeSeries, "indexTimeSeries"); ArgumentChecker.notNull(multicurves, "multicurves"); checkNotionalAndFixedRate(swapDefinition); Annuity<? extends Coupon> iborLeg = swapDefinition.getIborLeg().toDerivative(valuationDate, indexTimeSeries); double dirtyIborLegPV = iborLeg.accept(PVDC, multicurves).getAmount(iborLeg.getCurrency()); double iborLegAccruedInterest = getAccrued(iborLegDayCount, calendar, valuationDate, swapDefinition.getIborLeg(), indexTimeSeries); double cleanFloatingPV = (dirtyIborLegPV - iborLegAccruedInterest) * Math.signum(iborLeg.getNthPayment(0).getNotional()); AnnuityCouponFixed fixedLeg = swapDefinition.getFixedLeg().toDerivative(valuationDate); double accruedAmount = getAccrued(fixedLegDayCount, calendar, valuationDate, swapDefinition.getFixedLeg(), indexTimeSeries) * Math.signum(fixedLeg.getNthPayment(0).getNotional()); double dirtyAnnuity = METHOD_SWAP.presentValueBasisPoint(new SwapFixedCoupon<>(fixedLeg, iborLeg), multicurves); double cleanAnnuity = dirtyAnnuity - accruedAmount; return cleanFloatingPV / cleanAnnuity; }  Double parRate(SwapFixedIborDefinition swapDefinition, DayCount fixedLegDayCount,
      DayCount iborLegDayCount, Calendar calendar, ZonedDateTime valuationDate,
      ZonedDateTimeDoubleTimeSeries indexTimeSeries, MulticurveProviderDiscount multicurves); MultipleCurrencyAmount accruedInterest(SwapFixedIborDefinition swapDefinition, DayCount fixedLegDayCount,
      DayCount iborLegDayCount, Calendar calendar, ZonedDateTime valuationDate,
      ZonedDateTimeDoubleTimeSeries indexTimeSeries, MulticurveProviderDiscount multicurves);  }
@Test public void E2ETest() { ZonedDateTime valuationDate = VALUATION_DATE_SET[0]; MulticurveProviderDiscount multicurve = MULTICURVE_SET[0]; double parRate = CPRC.parRate(SWAP_FIXED_3M_PAY_DEFINITION, USD6MLIBOR3M.getFixedLegDayCount(), USD6MLIBOR3M .getIborIndex().getDayCount(), USD6MLIBOR3M.getCalendar(), valuationDate, TS_USDLIBOR3M, multicurve); assertRelative("consistencyTest", 0.021442847215148938, parRate, TOL); multicurve = MULTICURVE_SET[1]; parRate = CPRC.parRate(SWAP_FIXED_3M_PAY_DEFINITION, USD6MLIBOR3M.getFixedLegDayCount(), USD6MLIBOR3M .getIborIndex().getDayCount(), USD6MLIBOR3M.getCalendar(), valuationDate, TS_USDLIBOR3M, multicurve); assertRelative("consistencyTest", 0.0208613981377012, parRate, TOL); }