### Question:
Utils { public static Date parseHttpDate(String stringValue) throws ParseException { SimpleDateFormat formatRfc1123 = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz"); try { return formatRfc1123.parse(stringValue); } catch (ParseException e) { SimpleDateFormat formatRfc1036 = new SimpleDateFormat("EEE, dd-MMM-yy HH:mm:ss zzz"); try { return formatRfc1036.parse(stringValue); } catch (ParseException e1) { SimpleDateFormat formatAnsiCAsc = new SimpleDateFormat("EEE MMM d HH:mm:ss yyyy"); return formatAnsiCAsc.parse(stringValue); } } }  static List<String> parseHeaderValue(String headerValue); static byte[] getRemainingArray(ByteBuffer buffer); static String getHeaderFromList(List<T> list); static List<String> getStringList(List<T> list, Stringifier<T> stringifier); static String getHeaderFromList(List<T> list, Stringifier<T> stringifier); static void checkNotNull(T reference, String parameterName); static byte[] toArray(long value); static long toLong(byte[] bytes, int start, int end); static List<String> toString(byte[] bytes); static List<String> toString(byte[] bytes, int start, int end); static ByteBuffer appendBuffers(ByteBuffer buffer, ByteBuffer buffer1, int incomingBufferSize,
                                           int BUFFER_STEP_SIZE); static T getProperty(Map<String, Object> properties, String key, Class<T> type); @SuppressWarnings("unchecked") static T getProperty(final Map<String, Object> properties, final String key, final Class<T> type,
                                    final T defaultValue); static int getWsPort(URI uri); static int getWsPort(URI uri, String scheme); static Date parseHttpDate(String stringValue); static String stringifyUpgradeRequest(UpgradeRequest upgradeRequest); static String stringifyUpgradeResponse(UpgradeResponse upgradeResponse);  }### Answer:
@Test public void testParseHttpDateRfc1123() { try { Date date = Utils.parseHttpDate("Sun, 06 Nov 1994 08:49:37 GMT"); assertNotNull("Date cannot be null", date); } catch (ParseException e) { fail("Cannot parse valid date"); } }
@Test public void testParseHttpDateRfc1036() { try { Date date = Utils.parseHttpDate("Sunday, 06-Nov-94 08:49:37 GMT"); assertNotNull("Date cannot be null", date); } catch (ParseException e) { fail("Cannot parse valid date"); } }
@Test public void testParseHttpDateAnsiCAsc() { try { Date date = Utils.parseHttpDate("Sun Nov 6 08:49:37 1994"); assertNotNull("Date cannot be null", date); } catch (ParseException e) { fail("Cannot parse valid date"); } }
@Test public void testParseHttpDateFail() { try { Utils.parseHttpDate("2014-08-08 23:11:22 GMT"); fail("Invalid date cannot be parsed"); } catch (ParseException e) { } }