code: protected static void checkCache(final Request request, final Instant modified, final EntityTag etag) {
          final ResponseBuilder builder = request.evaluatePreconditions(from(modified), etag);
          if (nonNull(builder)) {
              throw new WebApplicationException(builder.build());
          }
      }
docs: Check the request for a cache-related response
  @param request the request
  @param modified the modified time
  @param etag the etag
  @throws WebApplicationException either a 412 Precondition Failed or a 304 Not Modified, depending on the context.