final FloatingInterestRateLeg cmsLeg = payIbor ? floatReceiveLeg : floatPayLeg;
final ExternalId regionId = payLeg.getRegionId();
final Calendar calendar = CalendarUtils.getCalendar(_regionSource, _holidaySource, regionId);
final Currency currency = ((InterestRateNotional) payLeg.getNotional()).getCurrency();
final AnnuityDefinition<? extends CouponFloatingDefinition> iborAnnuity = getIborSwapLegDefinition(effectiveDate, maturityDate, iborLeg, calendar, currency, payIbor);
final AnnuityCouponCMSDefinition cmsAnnuity = getCMSwapLegDefinition(effectiveDate, maturityDate, cmsLeg, calendar, currency, !payIbor);
return payIbor ? new SwapDefinition(iborAnnuity, cmsAnnuity) : new SwapDefinition(cmsAnnuity, iborAnnuity);
// Implementation note: In the converter, the pay leg is expected to be first.
}