@Override
    default int compareTo(Cookie c) {
        int v = name().compareTo(c.name());
        if (v != 0) {
            return v;
        }

        v = value().compareTo(c.value());
        if (v != 0) {
            return v;
        }

        final String path = path();
        final String otherPath = c.path();
        if (path == null) {
            if (otherPath != null) {
                return -1;
            }
        } else if (otherPath == null) {
            return 1;
        } else {
            v = path.compareTo(otherPath);
            if (v != 0) {
                return v;
            }
        }

        final String domain = domain();
        final String otherDomain = c.domain();
        if (domain == null) {
            if (otherDomain != null) {
                return -1;
            }
        } else if (otherDomain == null) {
            return 1;
        } else {
            v = domain.compareToIgnoreCase(otherDomain);
            return v;
        }

        return 0;
    }
Returns a new {@link Cookie} which is the result from the mutation by the specified {@link Consumer}.
This method is a shortcut for:
<pre>{@code
builder = toBuilder();
mutator.accept(builder);
return builder.build();
}</pre>

@see #toBuilder()
core/src/main/java/com/linecorp/armeria/common/Cookie.java