### Question:
DocumentReference { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof DocumentReference)) { return false; } DocumentReference that = (DocumentReference) o; return key.equals(that.key) && firestore.equals(that.firestore); } DocumentReference(DocumentKey key, FirebaseFirestore firestore); @NonNull FirebaseFirestore getFirestore(); @NonNull String getId(); @NonNull CollectionReference getParent(); @NonNull String getPath(); @NonNull CollectionReference collection(@NonNull String collectionPath); @NonNull Task<Void> set(@NonNull Object data); @NonNull Task<Void> set(@NonNull Object data, @NonNull SetOptions options); @NonNull Task<Void> update(@NonNull Map<String, Object> data); @NonNull Task<Void> update(
      @NonNull String field, @Nullable Object value, Object... moreFieldsAndValues); @NonNull Task<Void> update(
      @NonNull FieldPath fieldPath, @Nullable Object value, Object... moreFieldsAndValues); @NonNull Task<Void> delete(); @NonNull Task<DocumentSnapshot> get(); @NonNull Task<DocumentSnapshot> get(@NonNull Source source); @NonNull ListenerRegistration addSnapshotListener(
      @NonNull EventListener<DocumentSnapshot> listener); @NonNull ListenerRegistration addSnapshotListener(
      @NonNull Executor executor, @NonNull EventListener<DocumentSnapshot> listener); @NonNull ListenerRegistration addSnapshotListener(
      @NonNull Activity activity, @NonNull EventListener<DocumentSnapshot> listener); @NonNull ListenerRegistration addSnapshotListener(
      @NonNull MetadataChanges metadataChanges, @NonNull EventListener<DocumentSnapshot> listener); @NonNull ListenerRegistration addSnapshotListener(
      @NonNull Executor executor,
      @NonNull MetadataChanges metadataChanges,
      @NonNull EventListener<DocumentSnapshot> listener); @NonNull ListenerRegistration addSnapshotListener(
      @NonNull Activity activity,
      @NonNull MetadataChanges metadataChanges,
      @NonNull EventListener<DocumentSnapshot> listener); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testEquals() { DocumentReference foo = TestUtil.documentReference("rooms/foo"); DocumentReference fooDup = TestUtil.documentReference("rooms/foo"); DocumentReference bar = TestUtil.documentReference("rooms/bar"); assertEquals(foo, fooDup); assertNotEquals(foo, bar); assertEquals(foo.hashCode(), fooDup.hashCode()); assertNotEquals(foo.hashCode(), bar.hashCode()); }