final int len = HR_DATES.length;
for (int i = 0; i < len; i++) {
hrDates[i] = HR_DATES[i].plusDays(12);
hrTimes[i] = DAY_COUNT.getDayCountFraction(BASE_DATE, hrDates[i]);
}
final HazardRateCurve hazardRateCurve = new HazardRateCurve(hrDates, hrTimes, HR_RATES, OFFSET);
ZonedDateTime startDate = getStartDate(cds);
final ZonedDateTime endDate = cds.getMaturityDate();
final int lenExp = hrDates.length - 1 + YC_DATES.length - 1 + 2;
final DayCount act365 = DayCountFactory.INSTANCE.getDayCount("ACT/365");
final double[] ans = new double[lenExp];
for (int i = 0; i < YC_DATES.length - 1; i++) {
ans[i * 2 + 1] = YIELD_CURVE.getTimePoints()[i];
}
for (int i = 0; i < hrDates.length - 1; i++) {
ans[i * 2 + 2] = hazardRateCurve.getShiftedTimePoints()[i];
}
ans[0] = TimeCalculator.getTimeBetween(VALUATION_DATE, startDate, act365);
ans[lenExp - 1] = TimeCalculator.getTimeBetween(VALUATION_DATE, endDate, act365);
double[] res = CALCULATOR.constructCreditDefaultSwapContingentLegIntegrationSchedule(VALUATION_DATE, startDate, endDate, cds, YIELD_CURVE, hazardRateCurve);
assertEquals(lenExp, res.length);