### Question:
DateUtils { public static Date create(int year, int month, int date) { Calendar cal = Calendar.getInstance(); cal.clear(); cal.set(year, month - 1, date); return cal.getTime(); }  static Date create(int year, int month, int date); static Date create(int year, int month, int date, int hour, int minute, int second);  }### Answer:
@Test public void createYMD() { Date date = DateUtils.create(2010, 4, 12); DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); assertThat(df.format(date), is("2010-04-12 00:00:00")); }
@Test public void createYMD_HMS() { Date date = DateUtils.create(2010, 4, 12, 1, 2, 3); DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); assertThat(df.format(date), is("2010-04-12 01:02:03")); }