ScheduleCalculator { public static ZonedDateTime getAdjustedDate(final ZonedDateTime date, final int shiftDays, final Calendar calendar) { ArgumentChecker.notNull(date, "date"); ArgumentChecker.notNull(calendar, "calendar"); ZonedDateTime result = date; while (!calendar.isWorkingDay(result.toLocalDate())) { result = result.plusDays(1); } if (shiftDays > 0) { for (int loopday = 0; loopday < shiftDays; loopday++) { result = result.plusDays(1); while (!calendar.isWorkingDay(result.toLocalDate())) { result = result.plusDays(1); } } } else { for (int loopday = 0; loopday < -shiftDays; loopday++) { result = result.minusDays(1); while (!calendar.isWorkingDay(result.toLocalDate())) { result = result.minusDays(1); } } } return result; } private  ScheduleCalculator(); static ZonedDateTime getAdjustedDate(final ZonedDateTime date, final int shiftDays, final Calendar calendar); static ZonedDateTime[] getAdjustedDate(final ZonedDateTime[] dates, final int shiftDays, final Calendar calendar); static ZonedDateTime getAdjustedDate(final ZonedDateTime date, final Period shiftDays, final Calendar calendar); static LocalDate getAdjustedDate(final LocalDate date, final int shiftDays, final Calendar calendar); static ZonedDateTime getAdjustedDate(final ZonedDateTime startDate, final Period tenor, final BusinessDayConvention convention, final Calendar calendar); static ZonedDateTime getAdjustedDate(final ZonedDateTime startDate, final Period tenor, final BusinessDayConvention convention, final Calendar calendar,
      final boolean endOfMonthRule); static ZonedDateTime getAdjustedDate(
      final ZonedDateTime startDate,
      final Period period,
      final BusinessDayConvention convention,
      final Calendar calendar,
      final RollDateAdjuster rollDateAdjuster); static ZonedDateTime getAdjustedDate(final ZonedDateTime startDate, final Tenor tenor, final BusinessDayConvention convention, final Calendar calendar,
      final boolean endOfMonthRule); static ZonedDateTime getAdjustedDate(final ZonedDateTime startDate, final Period tenor, final GeneratorDeposit generator); static ZonedDateTime getAdjustedDate(final ZonedDateTime startDate, final Period tenor, final IborIndex index, final Calendar calendar); static ZonedDateTime getAdjustedDate(final ZonedDateTime startDate, final IborIndex index, final Calendar calendar); static ZonedDateTime[] getAdjustedDate(final ZonedDateTime[] startDates, final IborIndex index, final Calendar calendar); static ZonedDateTime[] getUnadjustedDateSchedule(final ZonedDateTime startDate, final ZonedDateTime endDate, final Period tenorPeriod, final StubType stub); static ZonedDateTime[] getUnadjustedDateSchedule(final ZonedDateTime startDate, final ZonedDateTime endDate, final Period tenorPeriod, final boolean stubShort,
      final boolean fromEnd); static ZonedDateTime[] getAdjustedDateSchedule(final ZonedDateTime[] dates, final BusinessDayConvention convention, final Calendar calendar,
      final boolean eomApply); static ZonedDateTime[] getAdjustedDateSchedule(final ZonedDateTime[] dates, final BusinessDayConvention convention, final Calendar calendar,
      final boolean eomApply, final RollDateAdjuster adjuster); static ZonedDateTime[] getAdjustedDateSchedule(final ZonedDateTime startDate, final ZonedDateTime endDate, final Period schedulePeriod, final boolean stubShort,
      final boolean fromEnd, final BusinessDayConvention convention, final Calendar calendar, final boolean eomRule); static ZonedDateTime[] getAdjustedDateSchedule(final ZonedDateTime startDate, final ZonedDateTime endDate, final Period schedulePeriod, final boolean stubShort,
      final boolean fromEnd, final BusinessDayConvention convention, final Calendar calendar, final boolean eomRule, final RollDateAdjuster adjuster); static ZonedDateTime[] getAdjustedDateSchedule(final ZonedDateTime startDate, final ZonedDateTime endDate, final Period schedulePeriod, final StubType stub,
      final BusinessDayConvention convention, final Calendar calendar, final boolean eomRule); static ZonedDateTime[] getAdjustedDateSchedule(final ZonedDateTime startDate, final ZonedDateTime endDate, final Period schedulePeriod, final StubType stub,
      final BusinessDayConvention convention, final Calendar calendar, final boolean eomRule, final RollDateAdjuster adjuster); static ZonedDateTime[] getAdjustedDateSchedule(
      ZonedDateTime startDate,
      ZonedDateTime endDate,
      Period schedulePeriod,
      StubType stub,
      BusinessDayConvention convention,
      Calendar calendar,
      RollDateAdjuster adjuster); static ZonedDateTime[] getAdjustedDateSchedule(
      final ZonedDateTime[] startDates,
      final Period schedulePeriod,
      final BusinessDayConvention businessDayConvention,
      final Calendar calendar,
      final RollDateAdjuster adjuster); static ZonedDateTime[] getAdjustedDateSchedule(final ZonedDateTime startDate, final ZonedDateTime endDate, final Frequency scheduleFrequency,
      final boolean stubShort, final boolean fromEnd, final BusinessDayConvention convention, final Calendar calendar, final boolean eomRule); static ZonedDateTime[] getAdjustedDateSchedule(final ZonedDateTime startDate, final Period tenorTotal, final Period tenorPeriod, final boolean stubShort,
      final boolean fromEnd, final BusinessDayConvention convention, final Calendar calendar, final boolean eomRule); static ZonedDateTime[] getAdjustedDateSchedule(final ZonedDateTime startDate, final Period tenorTotal, final boolean stubShort, final boolean fromEnd,
      final IborIndex index, final Calendar calendar); static ZonedDateTime[] getUnadjustedDateSchedule(final ZonedDateTime effectiveDate, final ZonedDateTime maturityDate, final Frequency frequency); static ZonedDateTime[] getUnadjustedDateSchedule(final ZonedDateTime effectiveDate, final ZonedDateTime accrualDate, final ZonedDateTime maturityDate,
      final Frequency frequency); static ZonedDateTime[] getUnadjustedDateSchedule(final ZonedDateTime effectiveDate, final ZonedDateTime accrualDate, final ZonedDateTime maturityDate,
      final Period period); static ZonedDateTime[] getBackwardsUnadjustedDateSchedule(final ZonedDateTime effectiveDate, final ZonedDateTime maturityDate, final Frequency frequency); static ZonedDateTime[] getAdjustedDateSchedule(final ZonedDateTime[] dates, final BusinessDayConvention convention, final Calendar calendar); static ZonedDateTime[] getAdjustedDateSchedule(final ZonedDateTime[] dates, final BusinessDayConvention convention, final Calendar calendar,
      final int settlementDays); static ZonedDateTime getAdjustedDate(final ZonedDateTime originalDate, final BusinessDayConvention convention, 
      final Calendar calendar, final int offset); static ZonedDateTime[] getAdjustedDateSchedule(final ZonedDateTime startDate, final ZonedDateTime endDate, final Period period,
      final BusinessDayConvention businessDayConvention, final Calendar calendar, final boolean isEOM, final boolean stubShort); static ZonedDateTime[] getAdjustedDateSchedule(final ZonedDateTime startDate, final ZonedDateTime endDate, final Frequency frequency,
      final BusinessDayConvention businessDayConvention, final Calendar calendar, final boolean isEOM); static ZonedDateTime[] getAdjustedDateSchedule(final ZonedDateTime startDate, final ZonedDateTime endDate, final Period period,
      final BusinessDayConvention businessDayConvention, final Calendar calendar, final boolean isEOM); static ZonedDateTime[] getAdjustedDateSchedule(final ZonedDateTime startDate, final Period tenor, final Period period,
      final BusinessDayConvention businessDayConvention, final Calendar calendar, final boolean isEOM, final boolean shortStub); static ZonedDateTime[] getAdjustedDateSchedule(final ZonedDateTime startDate, final Period tenorAnnuity, final Period periodPayments,
      final BusinessDayConvention businessDayConvention, final Calendar calendar, final boolean isEOM); static ZonedDateTime[] getSettlementDateSchedule(final ZonedDateTime[] dates, final Calendar calendar, final BusinessDayConvention businessDayConvention,
      final int settlementDays); static LocalDate[] getSettlementDateSchedule(final LocalDate[] dates, final Calendar calendar, final BusinessDayConvention businessDayConvention,
      final int settlementDays); static ZonedDateTime[] getAdjustedResetDateSchedule(final ZonedDateTime effectiveDate, final ZonedDateTime[] dates, final BusinessDayConvention convention,
      final Calendar calendar, final int settlementDays); static ZonedDateTime[] getAdjustedMaturityDateSchedule(final ZonedDateTime effectiveDate, final ZonedDateTime[] dates, final BusinessDayConvention convention,
      final Calendar calendar, final Frequency frequency); static double[] getTimes(final ZonedDateTime[] dates, final DayCount dayCount, final ZonedDateTime fromDate); static int numberOfNegativeValues(final double[] periods); static double[] removeFirstNValues(final double[] data, final int n); static double[] getYearFractions(final ZonedDateTime[] dates, final DayCount dayCount, final ZonedDateTime fromDate); static ZonedDateTime[] getStartDates(final ZonedDateTime startDate, final ZonedDateTime[] endDates);  }
@Test public void adjustedDatesDays() { final ZonedDateTime aMonday = DateUtils.getUTCDate(2011, 12, 12); final ZonedDateTime aTuesday = DateUtils.getUTCDate(2011, 12, 13); final ZonedDateTime aWednesday = DateUtils.getUTCDate(2011, 12, 14); final ZonedDateTime aThursday = DateUtils.getUTCDate(2011, 12, 15); final ZonedDateTime aFriday = DateUtils.getUTCDate(2011, 12, 16); final ZonedDateTime aSaturday = DateUtils.getUTCDate(2011, 12, 17); final ZonedDateTime aSunday = DateUtils.getUTCDate(2011, 12, 18); final ZonedDateTime aMonday2 = DateUtils.getUTCDate(2011, 12, 19); final ZonedDateTime aTuesday2 = DateUtils.getUTCDate(2011, 12, 20); final ZonedDateTime aWednesday2 = DateUtils.getUTCDate(2011, 12, 21); assertEquals("Adjusted date", aMonday, ScheduleCalculator.getAdjustedDate(aMonday, 0, CALENDAR)); assertEquals("Adjusted date", aFriday, ScheduleCalculator.getAdjustedDate(aFriday, 0, CALENDAR)); assertArrayEquals("Adjusted date", new ZonedDateTime[] {aMonday, aTuesday }, ScheduleCalculator.getAdjustedDate(new ZonedDateTime[] {aMonday, aTuesday }, 0, CALENDAR)); assertEquals("Adjusted date", aMonday2, ScheduleCalculator.getAdjustedDate(aSaturday, 0, CALENDAR)); assertEquals("Adjusted date", aMonday2, ScheduleCalculator.getAdjustedDate(aSunday, 0, CALENDAR)); assertEquals("Adjusted date", aTuesday, ScheduleCalculator.getAdjustedDate(aMonday, 1, CALENDAR)); assertEquals("Adjusted date", aMonday2, ScheduleCalculator.getAdjustedDate(aFriday, 1, CALENDAR)); assertEquals("Adjusted date", aTuesday2, ScheduleCalculator.getAdjustedDate(aSaturday, 1, CALENDAR)); assertEquals("Adjusted date", aTuesday2, ScheduleCalculator.getAdjustedDate(aSunday, 1, CALENDAR)); assertEquals("Adjusted date", aWednesday, ScheduleCalculator.getAdjustedDate(aMonday, 2, CALENDAR)); assertEquals("Adjusted date", aWednesday, ScheduleCalculator.getAdjustedDate(aMonday, Period.ofDays(2), CALENDAR)); assertEquals("Adjusted date", aTuesday2, ScheduleCalculator.getAdjustedDate(aFriday, 2, CALENDAR)); assertEquals("Adjusted date", aWednesday2, ScheduleCalculator.getAdjustedDate(aSaturday, 2, CALENDAR)); assertEquals("Adjusted date", aWednesday2, ScheduleCalculator.getAdjustedDate(aSunday, 2, CALENDAR)); assertEquals("Adjusted date", aMonday, ScheduleCalculator.getAdjustedDate(aWednesday, -2, CALENDAR)); assertEquals("Adjusted date", aFriday, ScheduleCalculator.getAdjustedDate(aTuesday2, -2, CALENDAR)); assertEquals("Adjusted date", aThursday, ScheduleCalculator.getAdjustedDate(aSaturday, -2, CALENDAR)); assertEquals("Adjusted date", aThursday, ScheduleCalculator.getAdjustedDate(aSunday, -2, CALENDAR)); }
@Test(expectedExceptions = IllegalArgumentException.class) public void adjustedDatesDaysNullDate() { ScheduleCalculator.getAdjustedDate((ZonedDateTime) null, 2, CALENDAR); }
@Test(expectedExceptions = IllegalArgumentException.class) public void adjustedDatesDaysNullCalendar() { ScheduleCalculator.getAdjustedDate(NOW, 2, null); }
@Test public void adjustedDatesPeriod() { final Period m1 = Period.ofMonths(1); final Period m2 = Period.ofMonths(2); final Period m3 = Period.ofMonths(3); final Period m6 = Period.ofMonths(6); final ZonedDateTime stdStart = DateUtils.getUTCDate(2011, 11, 15); final ZonedDateTime stdEnd = DateUtils.getUTCDate(2011, 12, 15); assertEquals("Adjusted date", stdEnd, ScheduleCalculator.getAdjustedDate(stdStart, m1, MOD_FOL, CALENDAR)); assertEquals("Adjusted date", stdEnd, ScheduleCalculator.getAdjustedDate(stdStart, m1, MOD_FOL, CALENDAR, true)); assertEquals("Adjusted date", stdEnd, ScheduleCalculator.getAdjustedDate(stdStart, m1, MOD_FOL, CALENDAR, false)); final ZonedDateTime ngbdStart = DateUtils.getUTCDate(2011, 11, 17); final ZonedDateTime ngbdEnd = DateUtils.getUTCDate(2011, 12, 19); assertEquals("Adjusted date", ngbdEnd, ScheduleCalculator.getAdjustedDate(ngbdStart, m1, MOD_FOL, CALENDAR)); assertEquals("Adjusted date", ngbdEnd, ScheduleCalculator.getAdjustedDate(ngbdStart, m1, MOD_FOL, CALENDAR, true)); assertEquals("Adjusted date", ngbdEnd, ScheduleCalculator.getAdjustedDate(ngbdStart, m1, MOD_FOL, CALENDAR, false)); final ZonedDateTime eom31NGBD = DateUtils.getUTCDate(2011, 7, 29); assertEquals("Adjusted date", DateUtils.getUTCDate(2011, 10, 31), ScheduleCalculator.getAdjustedDate(eom31NGBD, m3, MOD_FOL, CALENDAR)); assertEquals("Adjusted date", DateUtils.getUTCDate(2011, 10, 31), ScheduleCalculator.getAdjustedDate(eom31NGBD, m3, MOD_FOL, CALENDAR, true)); assertEquals("Adjusted date", DateUtils.getUTCDate(2011, 10, 31), ScheduleCalculator.getAdjustedDate(eom31NGBD, m3, MOD_FOL, CALENDAR, false)); assertEquals("Adjusted date", DateUtils.getUTCDate(2011, 9, 29), ScheduleCalculator.getAdjustedDate(eom31NGBD, m2, MOD_FOL, CALENDAR)); assertEquals("Adjusted date", DateUtils.getUTCDate(2011, 9, 30), ScheduleCalculator.getAdjustedDate(eom31NGBD, m2, MOD_FOL, CALENDAR, true)); assertEquals("Adjusted date", DateUtils.getUTCDate(2011, 9, 29), ScheduleCalculator.getAdjustedDate(eom31NGBD, m2, MOD_FOL, CALENDAR, false)); final ZonedDateTime eom30 = DateUtils.getUTCDate(2011, 11, 30); assertEquals("Adjusted date", DateUtils.getUTCDate(2012, 5, 30), ScheduleCalculator.getAdjustedDate(eom30, m6, MOD_FOL, CALENDAR)); assertEquals("Adjusted date", DateUtils.getUTCDate(2012, 5, 31), ScheduleCalculator.getAdjustedDate(eom30, m6, MOD_FOL, CALENDAR, true)); assertEquals("Adjusted date", DateUtils.getUTCDate(2012, 5, 30), ScheduleCalculator.getAdjustedDate(eom30, m6, MOD_FOL, CALENDAR, false)); assertEquals("Adjusted date", stdEnd, ScheduleCalculator.getAdjustedDate(stdStart, m1, GENERATOR_DEPOSIT)); assertEquals("Adjusted date", ngbdEnd, ScheduleCalculator.getAdjustedDate(ngbdStart, m1, GENERATOR_DEPOSIT)); assertEquals("Adjusted date", DateUtils.getUTCDate(2011, 10, 31), ScheduleCalculator.getAdjustedDate(eom31NGBD, m3, GENERATOR_DEPOSIT)); assertEquals("Adjusted date", DateUtils.getUTCDate(2011, 9, 30), ScheduleCalculator.getAdjustedDate(eom31NGBD, m2, GENERATOR_DEPOSIT)); assertEquals("Adjusted date", DateUtils.getUTCDate(2012, 5, 31), ScheduleCalculator.getAdjustedDate(eom30, m6, GENERATOR_DEPOSIT)); assertEquals("Adjusted date", stdEnd, ScheduleCalculator.getAdjustedDate(stdStart, m1, INDEX_EURIBOR6M, CALENDAR)); assertEquals("Adjusted date", ngbdEnd, ScheduleCalculator.getAdjustedDate(ngbdStart, m1, INDEX_EURIBOR6M, CALENDAR)); assertEquals("Adjusted date", DateUtils.getUTCDate(2011, 10, 31), ScheduleCalculator.getAdjustedDate(eom31NGBD, m3, INDEX_EURIBOR6M, CALENDAR)); assertEquals("Adjusted date", DateUtils.getUTCDate(2011, 9, 30), ScheduleCalculator.getAdjustedDate(eom31NGBD, m2, INDEX_EURIBOR6M, CALENDAR)); assertEquals("Adjusted date", DateUtils.getUTCDate(2012, 5, 31), ScheduleCalculator.getAdjustedDate(eom30, m6, INDEX_EURIBOR6M, CALENDAR)); assertEquals("Adjusted date", DateUtils.getUTCDate(2012, 5, 31), ScheduleCalculator.getAdjustedDate(eom30, INDEX_EURIBOR6M, CALENDAR)); assertArrayEquals("Adjusted date", new ZonedDateTime[] {DateUtils.getUTCDate(2012, 5, 31), DateUtils.getUTCDate(2012, 5, 31) }, ScheduleCalculator.getAdjustedDate(new ZonedDateTime[] {eom30, eom30 }, INDEX_EURIBOR6M, CALENDAR)); }
@Test public void adjustedDatesTenor() { final Tenor m1 = Tenor.of(Period.ofMonths(1)); final Tenor m2 = Tenor.of(Period.ofMonths(2)); final Tenor m3 = Tenor.of(Period.ofMonths(3)); final ZonedDateTime stdStart = DateUtils.getUTCDate(2011, 11, 15); final ZonedDateTime stdEnd = DateUtils.getUTCDate(2011, 12, 15); assertEquals("Adjusted date tenor", stdEnd, ScheduleCalculator.getAdjustedDate(stdStart, m1, MOD_FOL, CALENDAR, true)); assertEquals("Adjusted date tenor", stdEnd, ScheduleCalculator.getAdjustedDate(stdStart, m1, MOD_FOL, CALENDAR, false)); final ZonedDateTime ngbdStart = DateUtils.getUTCDate(2011, 11, 17); final ZonedDateTime ngbdEnd = DateUtils.getUTCDate(2011, 12, 19); assertEquals("Adjusted date tenor", ngbdEnd, ScheduleCalculator.getAdjustedDate(ngbdStart, m1, MOD_FOL, CALENDAR, true)); assertEquals("Adjusted date tenor", ngbdEnd, ScheduleCalculator.getAdjustedDate(ngbdStart, m1, MOD_FOL, CALENDAR, false)); final ZonedDateTime eom31NGBD = DateUtils.getUTCDate(2011, 7, 29); assertEquals("Adjusted date tenor", DateUtils.getUTCDate(2011, 10, 31), ScheduleCalculator.getAdjustedDate(eom31NGBD, m3, MOD_FOL, CALENDAR, true)); assertEquals("Adjusted date tenor", DateUtils.getUTCDate(2011, 10, 31), ScheduleCalculator.getAdjustedDate(eom31NGBD, m3, MOD_FOL, CALENDAR, false)); assertEquals("Adjusted date tenor", DateUtils.getUTCDate(2011, 9, 30), ScheduleCalculator.getAdjustedDate(eom31NGBD, m2, MOD_FOL, CALENDAR, true)); assertEquals("Adjusted date tenor", DateUtils.getUTCDate(2011, 9, 29), ScheduleCalculator.getAdjustedDate(eom31NGBD, m2, MOD_FOL, CALENDAR, false)); final Tenor on = Tenor.OVERNIGHT; final ZonedDateTime stdStartON = DateUtils.getUTCDate(2013, 12, 19); final ZonedDateTime stdEndON = DateUtils.getUTCDate(2013, 12, 20); assertEquals("Adjusted date tenor", stdEndON, ScheduleCalculator.getAdjustedDate(stdStartON, on, MOD_FOL, CALENDAR, true)); assertEquals("Adjusted date tenor", stdEndON, ScheduleCalculator.getAdjustedDate(stdStartON, on, MOD_FOL, CALENDAR, false)); final ZonedDateTime eomStartON = DateUtils.getUTCDate(2013, 10, 31); final ZonedDateTime eomEndON = DateUtils.getUTCDate(2013, 11, 1); assertEquals("Adjusted date tenor", eomEndON, ScheduleCalculator.getAdjustedDate(eomStartON, on, MOD_FOL, CALENDAR, true)); assertEquals("Adjusted date tenor", eomEndON, ScheduleCalculator.getAdjustedDate(eomStartON, on, MOD_FOL, CALENDAR, false)); final ZonedDateTime weStartON = DateUtils.getUTCDate(2013, 12, 20); final ZonedDateTime weEndON = DateUtils.getUTCDate(2013, 12, 23); assertEquals("Adjusted date tenor", weEndON, ScheduleCalculator.getAdjustedDate(weStartON, on, MOD_FOL, CALENDAR, true)); assertEquals("Adjusted date tenor", weEndON, ScheduleCalculator.getAdjustedDate(weStartON, on, MOD_FOL, CALENDAR, false)); final Tenor tn = Tenor.TN; final ZonedDateTime stdStartTN = DateUtils.getUTCDate(2013, 12, 18); final ZonedDateTime stdEndTN = DateUtils.getUTCDate(2013, 12, 20); assertEquals("Adjusted date tenor", stdEndTN, ScheduleCalculator.getAdjustedDate(stdStartTN, tn, MOD_FOL, CALENDAR, true)); assertEquals("Adjusted date tenor", stdEndTN, ScheduleCalculator.getAdjustedDate(stdStartTN, tn, MOD_FOL, CALENDAR, false)); final ZonedDateTime eomStartTN = DateUtils.getUTCDate(2013, 10, 30); final ZonedDateTime eomEndTN = DateUtils.getUTCDate(2013, 11, 1); assertEquals("Adjusted date tenor", eomEndTN, ScheduleCalculator.getAdjustedDate(eomStartTN, tn, MOD_FOL, CALENDAR, true)); assertEquals("Adjusted date tenor", eomEndTN, ScheduleCalculator.getAdjustedDate(eomStartTN, tn, MOD_FOL, CALENDAR, false)); final ZonedDateTime weStartTN = DateUtils.getUTCDate(2013, 12, 20); final ZonedDateTime weEndTN = DateUtils.getUTCDate(2013, 12, 24); assertEquals("Adjusted date tenor", weEndTN, ScheduleCalculator.getAdjustedDate(weStartTN, tn, MOD_FOL, CALENDAR, true)); assertEquals("Adjusted date tenor", weEndTN, ScheduleCalculator.getAdjustedDate(weStartTN, tn, MOD_FOL, CALENDAR, false)); }
@Test(expectedExceptions = IllegalArgumentException.class) public void adjustedDatesPeriodNullDate() { ScheduleCalculator.getAdjustedDate(null, PAYMENT_TENOR, MOD_FOL, CALENDAR); }
@Test(expectedExceptions = IllegalArgumentException.class) public void adjustedDatesPeriodNullTenor() { ScheduleCalculator.getAdjustedDate(NOW, null, MOD_FOL, CALENDAR); }
@Test(expectedExceptions = IllegalArgumentException.class) public void adjustedDatesPeriodNullBusinessDay() { ScheduleCalculator.getAdjustedDate(NOW, PAYMENT_TENOR, null, CALENDAR, true); }
@Test(expectedExceptions = IllegalArgumentException.class) public void adjustedDatesPeriodNullCalendar() { ScheduleCalculator.getAdjustedDate(NOW, PAYMENT_TENOR, MOD_FOL, null); }
@Test(expectedExceptions = IllegalArgumentException.class) public void adjustedDatesPeriodEOMNullDate() { ScheduleCalculator.getAdjustedDate(null, PAYMENT_TENOR, MOD_FOL, CALENDAR, true); }
@Test(expectedExceptions = IllegalArgumentException.class) public void adjustedDatesPeriodEOMNullPeriod() { ScheduleCalculator.getAdjustedDate(NOW, (Period) null, MOD_FOL, CALENDAR, true); }
@Test(expectedExceptions = IllegalArgumentException.class) public void adjustedDatesPeriodEOMNullTenor() { ScheduleCalculator.getAdjustedDate(NOW, (Tenor) null, MOD_FOL, CALENDAR, true); }
@Test(expectedExceptions = IllegalArgumentException.class) public void adjustedDatesPeriodEOMNullBusinessDay() { ScheduleCalculator.getAdjustedDate(NOW, PAYMENT_TENOR, null, CALENDAR, true); }
@Test(expectedExceptions = IllegalArgumentException.class) public void adjustedDatesPeriodEOMNullCalendar() { ScheduleCalculator.getAdjustedDate(NOW, PAYMENT_TENOR, MOD_FOL, null, true); }
@Test(expectedExceptions = IllegalArgumentException.class) public void adjustedDatesPeriodGeneratorNullDate() { ScheduleCalculator.getAdjustedDate(null, PAYMENT_TENOR, GENERATOR_DEPOSIT); }
@Test(expectedExceptions = IllegalArgumentException.class) public void adjustedDatesPeriodGeneratorNullTenor() { ScheduleCalculator.getAdjustedDate(NOW, null, GENERATOR_DEPOSIT); }
@Test(expectedExceptions = IllegalArgumentException.class) public void adjustedDatesPeriodGeneratorNullGenerator() { ScheduleCalculator.getAdjustedDate(NOW, PAYMENT_TENOR, (GeneratorDeposit) null); }
@Test(expectedExceptions = IllegalArgumentException.class) public void adjustedDatesPeriodIndexNullDate() { ScheduleCalculator.getAdjustedDate((ZonedDateTime) null, INDEX_EURIBOR6M, CALENDAR); }
@Test(expectedExceptions = IllegalArgumentException.class) public void adjustedDatesPeriodIndexNullIndex() { ScheduleCalculator.getAdjustedDate(NOW, (IborIndex) null, CALENDAR); }