// 5 29 30 31
// the 1st falls on a sunday, so dow0 == SU
assertEquals(
5,
Util.invertWeekdayNum(new WeekdayNum(-1, Weekday.SU), Weekday.SU, 31));
assertEquals(
5,
Util.invertWeekdayNum(new WeekdayNum(-1, Weekday.MO), Weekday.SU, 31));
assertEquals(
5,
Util.invertWeekdayNum(new WeekdayNum(-1, Weekday.TU), Weekday.SU, 31));
assertEquals(
4,
Util.invertWeekdayNum(new WeekdayNum(-1, Weekday.WE), Weekday.SU, 31));
assertEquals(
3,
Util.invertWeekdayNum(new WeekdayNum(-2, Weekday.WE), Weekday.SU, 31));
// February 2006
// # Su Mo Tu We Th Fr Sa
// 1 1 2 3 4
// 2 5 6 7 8 9 10 11
// 3 12 13 14 15 16 17 18
// 4 19 20 21 22 23 24 25
// 5 26 27 28
assertEquals(
4,
Util.invertWeekdayNum(new WeekdayNum(-1, Weekday.SU), Weekday.WE, 28));
assertEquals(
4,
Util.invertWeekdayNum(new WeekdayNum(-1, Weekday.MO), Weekday.WE, 28));
assertEquals(
4,
Util.invertWeekdayNum(new WeekdayNum(-1, Weekday.TU), Weekday.WE, 28));
assertEquals(
4,
Util.invertWeekdayNum(new WeekdayNum(-1, Weekday.WE), Weekday.WE, 28));
assertEquals(
3,
Util.invertWeekdayNum(new WeekdayNum(-2, Weekday.WE), Weekday.WE, 28));
}