### Question:
MongoDbUser extends UserImpl { @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof MongoDbUser)) return false; MongoDbUser that = (MongoDbUser) o; if (this.getId() != null ? !this.getId().equals(that.getId()) : that.getId() != null) return false; return true; } MongoDbUser(String id);  MongoDbUser(); List<String> getAuthorityCodes(); PageLayoutRepository getPageLayoutRepository(); void setAuthorityCodes(List<String> authorityCodes); List<MongoDbPersonAssociation> getFriends(); void setFriends(List<MongoDbPersonAssociation> friends); @Override void setAuthorities(Collection<Authority> authorities); @Override Collection<GrantedAuthority> getAuthorities(); @Override void addAuthority(Authority authority); @Override void removeAuthority(Authority authority); @Override PageLayout getDefaultPageLayout(); @Override boolean equals(Object o); @Override int hashCode(); void setPageLayoutRepository(PageLayoutRepository pageLayoutRepository);  }### Answer:
@Test public void equals_Same(){ assertTrue(user.equals(user)); }
@Test public void equals_Not_Same_Instance(){ Object o = new Object(); assertFalse(user.equals(o)); }
@Test public void equals_Null_Id(){ user.setId("123"); MongoDbUser r = new MongoDbUser(); assertFalse(user.equals(r)); assertFalse(r.equals(user)); }
@Test public void equals_Valid(){ user.setId("123"); MongoDbUser r = new MongoDbUser(); r.setId("123"); assertTrue(user.equals(r)); }
@Test public void equals_Same_Null(){ user.setId(null); MongoDbUser r = new MongoDbUser(); assertTrue(user.equals(r)); }