### Question:
DateTimeUtil { public static java.util.Date parseDate(String pattern, String date) throws ParseException { return parseDate(pattern, date, null); }  static java.util.Date parseDate(String pattern, String date); static java.util.Date parseDate(String pattern, String date, TimeZone timeZone); static Date parseDateTime(String dateTime); static java.util.Date parseDate(String date); static java.sql.Date parseSQLDate(String pattern, String date); static java.sql.Date parseSQLDate(String date); static java.sql.Timestamp parseTimestamp(String pattern, String dateTime); static java.sql.Timestamp parseTimestamp(String pattern, String dateTime, TimeZone timeZone); static java.sql.Timestamp parseTimestamp(String dateTime, TimeZone timeZone); static java.sql.Time parseTime(String pattern, String time); static java.sql.Time parseTime(String pattern, String time, TimeZone timeZone); static java.sql.Time parseTime(String time); static final String STANDARD_DATETIME_FORMAT; static final String ISO_DATETIME_FORMAT; static final String STANDARD_DATE_FORMAT; static final String STANDARD_TIME_FORMAT; static final String STANDARD_TIMEWITHMILLISEC_FORMAT; static final String STANDARD_DATETIMEWITHMILLISEC_FORMAT; static final String ISO_DATETIMEWITHMILLISEC_FORMAT; static final String[] dateTimeFormats; }### Answer:
@Test public void shouldParseDateInDefaultTimeZone() throws Exception { assertEquals(expected("2012-02-28", null), DateTimeUtil.parseDate("yyyy-MM-dd", "2012-02-28")); }
@Test public void shouldParseDateInChicagoTimeZone() throws Exception { assertEquals(expected("2012-02-28 06:00:00", "GMT"), DateTimeUtil.parseDate("yyyy-MM-dd Z", "2012-02-28 -0600")); }
@Test public void shouldParseDateWithTimeInDefaultTimeZone() throws Exception { assertEquals(expected("2012-02-28 02:10:15", null), DateTimeUtil.parseDate("yyyy-MM-dd HH:mm:ss", "2012-02-28 02:10:15")); }
@Test public void shouldParseDateWithTimeInChicagoTimeZone() throws Exception { assertEquals(expected("2012-02-28 00:00:00", "GMT"), DateTimeUtil.parseDate("yyyy-MM-dd HH:mm:ss Z", "2012-02-27 18:00:00 -0600")); }
@Test(expected = ParseException.class) public void shouldFailParseDateIfValueNotMatchPattern() throws Exception { DateTimeUtil.parseDate("HH:mm:ss Z", "8:10:15"); }