### Question:
CalendarUtil { public static List<Date> getWeekDates(int year, int month, int day) { List<Date> dates = new ArrayList<>(); LocalDate localDate = new LocalDate(year, month, day); for (int i = 1; i <= 7; i++) { LocalDate tempDate = localDate.withDayOfWeek(i); int tempMonth = tempDate.getMonthOfYear(); int type; if (tempMonth == month) { type = Date.TYPE_THIS_MONTH; } else if (tempMonth > month) { type = Date.TYPE_NEXT_MONTH; } else { type = Date.TYPE_LAST_MONTH; } dates.add(getDate(tempDate, type)); } 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 getWeekDate() throws Exception { List<Date> dates = CalendarUtil.getWeekDates(2018, 2, 1); assertEquals(29, dates.get(0).getDay()); assertEquals(4, dates.get(6).getDay()); List<Date> dates2 = CalendarUtil.getWeekDates(2018, 2, 13); assertEquals(12, dates2.get(0).getDay()); assertEquals(18, dates2.get(6).getDay()); List<Date> dates3 = CalendarUtil.getWeekDates(2018, 2, 28); assertEquals(26, dates3.get(0).getDay()); assertEquals(4, dates3.get(6).getDay()); }