class DocumentSnapshot {

  @Override
  public boolean equals(@Nullable Object obj) {
    if (this == obj) {
      return true;
    }
    if (!(obj instanceof DocumentSnapshot)) {
      return false;
    }
    DocumentSnapshot other = (DocumentSnapshot) obj;
    return firestore.equals(other.firestore)
        && key.equals(other.key)
        && (doc == null ? other.doc == null : doc.equals(other.doc))
        && metadata.equals(other.metadata);
  }

    DocumentSnapshot(
      FirebaseFirestore firestore,
      DocumentKey key,
      @Nullable Document doc,
      boolean isFromCache,
      boolean hasPendingWrites);

}