@SuppressWarnings("deprecated")
    default void setExpiryDate(Instant expiryDate) {
        setExpiryDate(DateUtils.toDate(expiryDate));
    }
Sets expiration date.
<p><strong>Note:</strong> the object returned by this method is considered
immutable. Changing it (e.g. using setTime()) could result in undefined behaviour. Do so at
your peril.</p>

@param expiryDate the {@link Instant} after which this cookie is no longer valid.
@see Cookie#getExpiryInstant()
@since 5.2
httpclient5/src/main/java/org/apache/hc/client5/http/cookie/SetCookie.java