@Override
    public int compare(final Cookie c1, final Cookie c2) {
        final int l1 = getPathLength(c1);
        final int l2 = getPathLength(c2);
        final int result = l2 - l1;
        if (result == 0) {
            final Date d1 = c1.getCreationDate();
            final Date d2 = c2.getCreationDate();
            if (d1 != null && d2 != null) {
                return (int) (d1.getTime() - d2.getTime());
            }
        }
        return result;
    }
This cookie comparator ensures that cookies with longer paths take precedence over
cookies with shorter path. Among cookies with equal path length cookies with ealier
creation time take precedence over cookies with later creation time

@since 4.4
ngrinder-runtime/src/main/java/org/apache/hc/client5/http/cookie/CookiePriorityComparator.java