### Question:
CalendarUtil { public static List<Date> getMonthDates(int year, int month) { LocalDate localDate = new LocalDate(year, month, 1); List<Date> dates = new ArrayList<>(); while (localDate.getMonthOfYear() <= month && localDate.getYear() == year) { dates.addAll(getWeekDates(localDate.getYear(), localDate.getMonthOfYear(), localDate.getDayOfMonth())); localDate = localDate.plusWeeks(1).withDayOfWeek(1); } return dates; }  static Date getDate(LocalDate localDate, int type); static List<List<Date>> getMonthOfWeekDates(int year, int month); static List<Date> getMonthDates(int year, int month); static List<Date> getWeekDates(int year, int month, int day); static int getDayForWeek(int y, int m, int d); static int[] positionToDate(int position, int startY, int startM); static int getMonthPosition(int year1, int month1, int year2, int month2); static int getWeekPosition(int startYear, int startMonth, int startDay, int year, int month, int day); static List<Date> getWeekDaysForPosition(int startYear, int startMonth, int startDay, int positionWeek); static LocalDate getCurrentDate(); static int getMaxDayByYearMonth(int year,int month);  }### Answer:
@Test public void getMonthDates() throws Exception { List<Date> dates = CalendarUtil.getMonthDates(2018, 7); assertEquals(42, dates.size()); }