code: public boolean exists(String id) {
          if (id == null) {
              throw new IllegalArgumentException("id cannot be null");
          }
  
          if (_knownMissingIds.contains(id)) {
              return false;
          }
  
          if (documentsById.getValue(id) != null) {
              return true;
          }
  
          HeadDocumentCommand command = new HeadDocumentCommand(id, null);
  
          _requestExecutor.execute(command, sessionInfo);
  
          return command.getResult() != null;
      }
docs: Check if document exists without loading it