### Question:
DateUtil { public static Date parseRfc1123Date(String dateStr) { try { return RFC1123_DATE_FORMAT.parseDateTime(dateStr).toDate(); } catch (Exception e) { return null; } } private  DateUtil(); static Date parseRfc1123Date(String dateStr); static Date parseIso8601DateTime(String dateStr); static String formatIso8601Date(Date date); static String formatIso8601Date(long time); static String formatRfc1123Date(Date date); static String formatRfc1123Date(long timeStamp);  }### Answer:
@Test public void parse() { for (int i = 0, j = rfc1123text.length; i < j; ++i) { assertEquals(timeStamps[i].getTime(), DateUtil.parseRfc1123Date(rfc1123text[i]).getTime()); } }
@Test public void parseMalformedRfc1123() { assertNull(DateUtil.parseRfc1123Date("Invalid date format")); }
@Test public void parseWrongTimeZone() { String expires = "Mon, 12 May 2008 09:23:29 PDT"; assertNull(DateUtil.parseRfc1123Date(expires)); }
@Test public void parseRfc1036() { String expires = "Sunday, 06-Nov-94 08:49:37 GMT"; assertNull(DateUtil.parseRfc1123Date(expires)); }
@Test public void parseAsctime() { String expires = "Sun Nov 6 08:49:37 1994"; assertNull(DateUtil.parseRfc1123Date(expires)); }