### Question:
DateUtils { public static int getWeekByDate(Date date) { int a = 0; GregorianCalendar cal = new GregorianCalendar(); try { cal.setTime(date); a = cal.get(Calendar.DAY_OF_WEEK); } catch (Exception ex) { log.error("通过Date得到week发生异常", ex); } return a; }  static int getWeekByDate(Date date); static String getCNDefaultDate(); static String getCNWeek(int week); static String getFormatedDate(Date date); static String getFormatedDate(Date now, String format); static String getSimpleFormatDate(Date date); static String getSimpleFormatedDateNow(); static String getStandTime(); static Date parseStringToDate(String date); static Date parseStringToDate(String date, String format);  }### Answer:
@Test public void testGetWeekByDate() { Date date = new Date(); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); int week = calendar.get(Calendar.DAY_OF_WEEK); Assert.assertEquals("DateUtils.getWeekByDate返回值应该为：" + week, week, DateUtils.getWeekByDate(date)); }