final boolean cap = RANDOM.nextBoolean();
final String payTicker = "USDISDA10" + payTenor.getPeriod().toString();
final ExternalId payIdentifier = ExternalSchemes.syntheticSecurityId(payTicker);
final String receiveTicker = "USDISDA10" + receiveTenor.getPeriod().toString();
final ExternalId receiveIdentifier = ExternalSchemes.syntheticSecurityId(receiveTicker);
final CapFloorCMSSpreadSecurity security = new CapFloorCMSSpreadSecurity(_tradeDate, maturityDate, _notional, payIdentifier, receiveIdentifier, strike,
PeriodFrequency.ANNUAL, CURRENCY, ACT_360, payer, cap);
security.setName(CURRENCY.getCode() + " " + FORMAT.format(_notional / 1000000) + (cap ? "MM cap spread " : "MM floor spread ") + "@ " + FORMAT.format(strike) +
"%, pay " + payTenor.getPeriod().normalized().getYears() + "Y ISDA fixing" + ", receive " +
receiveTenor.getPeriod().normalized().getYears() + "Y ISDA fixing" +
" (" + _tradeDate.toLocalDate().toString() + " - " + maturityDate.toLocalDate().toString() + ")");
return security;
}