### Question:
DateUtils { public static boolean isBefore( final MessageHeaders message1, final MessageHeaders message2, final String headerName) { if (message1 != null && message2 != null) { final Header dateHeader1 = message1.getFirstHeader(headerName); if (dateHeader1 != null) { final Header dateHeader2 = message2.getFirstHeader(headerName); if (dateHeader2 != null) { final Date date1 = parseDate(dateHeader1.getValue()); if (date1 != null) { final Date date2 = parseDate(dateHeader2.getValue()); if (date2 != null) { return date1.before(date2); } } } } } return false; } private  DateUtils(); static Date parseDate(final String dateValue); static Date parseDate(final MessageHeaders headers, final String headerName); static boolean isAfter(
            final MessageHeaders message1,
            final MessageHeaders message2,
            final String headerName); static boolean isBefore(
            final MessageHeaders message1,
            final MessageHeaders message2,
            final String headerName); static Date parseDate(final String dateValue, final String[] dateFormats); static Date parseDate(
            final String dateValue,
            final String[] dateFormats,
            final Date startDate); static String formatDate(final Date date); static String formatDate(final Date date, final String pattern); static void clearThreadLocal(); static final String PATTERN_RFC1123; static final String PATTERN_RFC1036; static final String PATTERN_ASCTIME; static final TimeZone GMT; }### Answer:
@Test public void testIsBefore() throws Exception { final HeaderGroup message1 = new HeaderGroup(); final HeaderGroup message2 = new HeaderGroup(); Assert.assertThat(DateUtils.isBefore(null, null, HttpHeaders.DATE), CoreMatchers.equalTo(false)); Assert.assertThat(DateUtils.isBefore(message1, message2, HttpHeaders.DATE), CoreMatchers.equalTo(false)); message1.setHeader(new BasicHeader(HttpHeaders.DATE, "huh?")); message2.setHeader(new BasicHeader(HttpHeaders.DATE, "eh?")); Assert.assertThat(DateUtils.isBefore(message1, message2, HttpHeaders.DATE), CoreMatchers.equalTo(false)); message1.setHeader(new BasicHeader(HttpHeaders.DATE, "huh?")); message2.setHeader(new BasicHeader(HttpHeaders.DATE, "Tuesday, 26-Dec-2017 00:00:00 GMT")); Assert.assertThat(DateUtils.isBefore(message1, message2, HttpHeaders.DATE), CoreMatchers.equalTo(false)); message1.setHeader(new BasicHeader(HttpHeaders.DATE, "Wednesday, 25-Dec-2017 00:00:00 GMT")); Assert.assertThat(DateUtils.isBefore(message1, message2, HttpHeaders.DATE), CoreMatchers.equalTo(true)); message1.setHeader(new BasicHeader(HttpHeaders.DATE, "Thursday, 27-Dec-2017 00:00:00 GMT")); Assert.assertThat(DateUtils.isBefore(message1, message2, HttpHeaders.DATE), CoreMatchers.equalTo(false)); }