tenor1 = getRandom(SHORT_TENORS);
tenor2 = getRandom(LONG_TENORS);
} while (tenor1.compareTo(tenor2) >= 0);
final int length = getRandom(tenor2.getPeriod().getYears() - 5) + 3;
final ZonedDateTime maturityDate = nextWorkingDay(startDate.plusYears(length), currency);
final ExternalId shortIdentifier = getUnderlying(currency, startDate.toLocalDate(), tenor1);
final ExternalId longIdentifier = getUnderlying(currency, startDate.toLocalDate(), tenor2);
final double strike = getRandom(STRIKES);
final Frequency frequency = getRandom(FREQUENCY);
final DayCount dayCount = getRandom(DAY_COUNT);
CapFloorCMSSpreadSecurity security = null;
if (shortIdentifier != null && longIdentifier != null) {