code: private void maybeSetLastModified(HttpServletResponse resp,
                                        long lastModified) {
          if (resp.containsHeader(HEADER_LASTMOD))
              return;
          if (lastModified >= 0)
              resp.setDateHeader(HEADER_LASTMOD, lastModified);
      }
docs: /*
  Sets the Last-Modified entity header field, if it has not
  already been set and if the value is meaningful.  Called before
  doGet, to ensure that headers are set before response data is
  written.  A subclass might have set this header already, so we
  check.