@Test public void testChildAddEvent_equals_previousChildName() { ChildAddEvent a = ChildAddEvent.create(mockDataSnapshot1, "foo"); ChildAddEvent b = ChildAddEvent.create(mockDataSnapshot1, "foo"); ChildAddEvent c = ChildAddEvent.create(mockDataSnapshot1, "bar"); ChildAddEvent d = ChildAddEvent.create(mockDataSnapshot1, null); assertThat(a) .isEqualTo(a) .isNotEqualTo(null) .isEqualTo(b) .isNotEqualTo(c) .isNotEqualTo(d); assertThat(a.hashCode()) .isEqualTo(b.hashCode()) .isNotEqualTo(c.hashCode()) .isNotEqualTo(d.hashCode()); }
@Override public int hashCode() { return dataSnapshot.hashCode(); }
ChildEvent { @Override public int hashCode() { return dataSnapshot.hashCode(); } }
ChildEvent { @Override public int hashCode() { return dataSnapshot.hashCode(); } ChildEvent(DataSnapshot dataSnapshot); }
ChildEvent { @Override public int hashCode() { return dataSnapshot.hashCode(); } ChildEvent(DataSnapshot dataSnapshot); @NonNull DataSnapshot dataSnapshot(); @Override boolean equals(Object o); @Override int hashCode(); }
ChildEvent { @Override public int hashCode() { return dataSnapshot.hashCode(); } ChildEvent(DataSnapshot dataSnapshot); @NonNull DataSnapshot dataSnapshot(); @Override boolean equals(Object o); @Override int hashCode();  }