public static boolean isAfter(
            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.after(date2);
                        }
                    }
                }
            }
        }
        return false;
    }
Tests if the first message is after (newer) than second one
using the given message header for comparison.

@param message1 the first message
@param message2 the second message
@param headerName header name

@return {@code true} if both messages contain a header with the given name
 and the value of the header from the first message is newer that of
 the second message.

@since 5.0
ngrinder-runtime/src/main/java/org/apache/hc/client5/http/utils/DateUtils.java