@Override
    public int compare(final Cookie c1, final Cookie c2) {
        final String path1 = normalizePath(c1);
        final String path2 = normalizePath(c2);
        if (path1.equals(path2)) {
            return 0;
        } else if (path1.startsWith(path2)) {
            return -1;
        } else if (path2.startsWith(path1)) {
            return 1;
        } else {
            // Does not really matter
            return 0;
        }
    }
This cookie comparator ensures that multiple cookies satisfying
a common criteria are ordered in the {@link Cookie} header such
that those with more specific Path attributes precede those with
less specific.

<p>
This comparator assumes that Path attributes of two cookies
path-match a commmon request-URI. Otherwise, the result of the
comparison is undefined.
</p>


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