public boolean allConditionalsMatch(final HttpRequest request, final HttpCacheEntry entry, final Instant now) {
        final boolean hasEtagValidator = hasSupportedEtagValidator(request);
        final boolean hasLastModifiedValidator = hasSupportedLastModifiedValidator(request);

        if (!hasEtagValidator && !hasLastModifiedValidator) {
            return true;
        }

        final boolean etagValidatorMatches = hasEtagValidator && etagValidatorMatches(request, entry);
        final boolean lastModifiedValidatorMatches = hasLastModifiedValidator && lastModifiedValidatorMatches(request, entry, now);

        if (hasEtagValidator && hasLastModifiedValidator
                && !(etagValidatorMatches && lastModifiedValidatorMatches)) {
            return false;
        } else if (hasEtagValidator && !etagValidatorMatches) {
            return false;
        }

        return !hasLastModifiedValidator || lastModifiedValidatorMatches;
    }
Check that conditionals that are part of this request match
@param request The current httpRequest being made
@param entry the cache entry
@param now right NOW in time
@return {@code true} if the request matches all conditionals
httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachedResponseSuitabilityChecker.java