docs: private Object convertReference(Object fieldValue) {
      DocumentReference reference;
      if (fieldValue instanceof String) {
        reference = new DocumentReference(firestore, path.append((String) fieldValue));
      } else if (fieldValue instanceof DocumentReference) {
        reference = (DocumentReference) fieldValue;
      } else {
        throw new IllegalArgumentException(
            "The corresponding value for FieldPath.documentId() must be a String or a "
                + "DocumentReference.");
      }
  
      if (!this.path.isPrefixOf(reference.getResourcePath())) {
        throw new IllegalArgumentException(
            String.format(
                "'%s' is not part of the query result set and cannot be used as a query boundary.",
                reference.getPath()));
      }
      if (!reference.getParent().getResourcePath().equals(this.path)) {
        throw new IllegalArgumentException(
            String.format(
                "Only a direct child can be used as a query boundary. Found: '%s'",
                reference.getPath()));
      }
  
      return reference;
    }