private List<Day> padMonthEnd(final List<Day> days) { log.debug("Entering with {}", days); List<Day> paddedDays = new ArrayList<>(days); for (int i = days.size(); i < 42; i++) { Day day = paddedDays.get(i - 1); paddedDays.add(new Day(day.getDayOfWeek().plus(1), 0, 0)); } return paddedDays; }
private List<Day> padMonthStart(final List<Day> days) { log.debug("Entering with {}", days); List<Day> paddedDays = new ArrayList<>(days); for (int i = 0; i < 6; i++) { Day day = paddedDays.get(0); if (day.getDayOfWeek() != DayOfWeek.SUNDAY) paddedDays.add(0, new Day(day.getDayOfWeek().minus(1), 0, 0)); else break; } return paddedDays; }