### Question:
DateUtil { public static Date parseYearMonthDay(String timeStr, Date defaultValue){ if(timeStr == null){ return defaultValue; } try { return yearMonthDaySdf.get().parse(timeStr); } catch (ParseException e) { return defaultValue; } }  static String getYearMonth(Date date); static String formateYearMonthDay(Date date); static Date parseYearMonthDay(String timeStr, Date defaultValue); static String formateDateTime(Date date); static Date parseDateTime(String timeStr, Date defaultValue); static final int getCurrentHour(); static final int getLastHour(); static final int getNextHour(); static Date getFirstDayOfCurMonth(); static Date getFirstDayInMonth(Date date); static Date getFirstDayInMonth(int month); static boolean isCurrentMonth(Date date);  }### Answer:
@Test public void testParseYearMonthDay() { assertEquals(new Date(1325347200000L), DateUtil.parseYearMonthDay("2012-01-01", null)); Date date = DateUtil.parseYearMonthDay("2012-12-01", null); ApiLogger.debug(date + ", " + date.getTime()); ApiLogger.debug(new Date(1000000000000L) + ", " + new Date(1000000000000L).getTime()); ApiLogger.debug(new Date(1000L * 60 * 43200) + ", " + new Date(1000L * 60 * 43200).getTime() + ", " + (1000L * 60 * 43200)); }