code: public CheckRequest[] flush() {
      if (cache == null) {
        return NO_REQUESTS;
      }
  
      // Thread safety - the current thread cleans up the cache, which may add multiple cached
      // aggregated operations to the output deque.
      synchronized (cache) {
        cache.cleanUp();
        ArrayList<CheckRequest> reqs = Lists.newArrayList();
        for (CachedItem item : out) {
          CheckRequest req = item.extractRequest();
          if (req != null) {
            reqs.add(req);
          }
        }
        out.clear();
        return reqs.toArray(new CheckRequest[reqs.size()]);
      }
    }
docs: Flushes this instance's cache.
  
  The instance's driver should call the this method every {@link #getFlushIntervalMillis()}
  milliseconds, and send the results to the check service.
  
  @return CheckRequest[] containing the CheckRequests that were pending