### Question:
DateUtils { public static String getFormatedDate(Date date) { return getFormatedDate(date, defaultDateFormat); }  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 testGetFormatedDateDate() { String strDate = DateUtils.getFormatedDate(new Date()); Assert.assertEquals(strDate + "应该为'yyyy-MM-dd HH:mm:ss'字符串！" + 19, 19, strDate.length()); strDate = DateUtils.getFormatedDate(null); Assert.assertNull("DateUtils.getFormatedDate(null)应该返回null！", strDate); }
@Test public void testGetFormatedDateDateString() { String format = "yyyy年MM月dd日 HH时mm分"; String strDate = DateUtils.getFormatedDate(new Date(), format); Assert.assertNotNull("格式化日期失败！format(" + format + ")", strDate); format = null; strDate = DateUtils.getFormatedDate(new Date(), format); Assert.assertNotNull("格式化日期失败！format=null", strDate); format = "日期格式化"; strDate = DateUtils.getFormatedDate(new Date(), format); Assert.assertEquals("格式化日期失败！format(" + format + ")", format, strDate); }