@Override
    public boolean clearExpired(final Date date) {
        if (date == null) {
            return false;
        }
        lock.writeLock().lock();
        try {
            boolean removed = false;
            for (final Iterator<Cookie> it = cookies.iterator(); it.hasNext(); ) {
                if (it.next().isExpired(date)) {
                    it.remove();
                    removed = true;
                }
            }
            return removed;
        } finally {
            lock.writeLock().unlock();
        }
    }
Removes all of {@link Cookie cookies} in this HTTP state
that have expired by the specified {@link Date date}.

@return true if any cookies were purged.

@see Cookie#isExpired(Date)
ngrinder-runtime/src/main/java/org/apache/hc/client5/http/cookie/BasicCookieStore.java