}
yieldCurve = new ISDADateCurve("ISDA", baseDate, ycDates, ycRates, offset);
final HazardRateCurve hazardRateCurve = new HazardRateCurve(hazDates, hazTimes, hazRates, offset);
for (int j = 5; j < 21; j += 3) {
final CreditDefaultSwapDefinition cds1 = CreditDefaultSwapDefinitionDataSets.getLegacyVanillaDefinition().withMaturityDate(valDate.plusYears(j));
final LocalDate[] res1Deprecated = ISDACompliantScheduleGenerator.toLocalDate(calculator.constructCreditDefaultSwapAccruedLegIntegrationSchedule(valDate, cds1, yieldCurve, hazardRateCurve, true));
final int nRes1Deprecated = res1Deprecated.length;
final LocalDate startDateLocal = ISDACompliantScheduleGenerator.toLocalDate(new ZonedDateTime[] {cds1.getStartDate() })[0];
/*
* Note cds1.getProtectionStart() == ture by default, thus .plusDays(1) is needed
*/
final LocalDate endDateLocal = ISDACompliantScheduleGenerator.toLocalDate(new ZonedDateTime[] {cds1.getMaturityDate().plusDays(1) })[0];
final LocalDate baseDateLocal = ISDACompliantScheduleGenerator.toLocalDate(new ZonedDateTime[] {baseDate })[0];
final LocalDate[] hazDatesLocal = ISDACompliantScheduleGenerator.toLocalDate(hazDates);
final LocalDate[] ycDatesLocal = ISDACompliantScheduleGenerator.toLocalDate(ycDates);
final LocalDate[] res1 = ISDACompliantScheduleGenerator.getIntegrationNodesAsDates(startDateLocal, endDateLocal, ycDatesLocal, hazDatesLocal);
final int nRes1 = res1.length;
// for (int i = 0; i < nRes1Deprecated; ++i) {
// System.out.println(res1Deprecated[i]);
// }
// System.out.println("\n");
// for (int i = 0; i < nRes1; ++i) {
// System.out.println(res1[i]);
// }
// System.out.println("\n");
assertEquals(nRes1Deprecated, nRes1);
for (int i = 0; i < nRes1; ++i) {
assertTrue(res1[i].equals(res1Deprecated[i]));
}
/*
* Note that valuation date is used only for start date and end date
* Other date points are computed with the base date contained in yield curve and hazard rate curve
*/
final double[] res2Deprecated = calculator.constructCreditDefaultSwapContingentLegIntegrationSchedule(baseDate, cds1.getStartDate(), cds1.getMaturityDate().plusDays(1),
cds1, yieldCurve, hazardRateCurve);
final int nRes2Deprecated = res2Deprecated.length;
final int m = ycDatesLocal.length;
/*