### Question:
GroupMembership { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GroupMembership that = (GroupMembership) o; if (userId != that.userId) return false; return groupId == that.groupId; } GroupMembership(int userId, int groupId); int getUserId(); void setUserId(int userId); int getGroupId(); void setGroupId(int groupId); Date getSharingUntil(); void setSharingUntil(Date sharingUntil); boolean isSharing(); void setSharing(boolean sharing); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void equals() throws Exception { assertTrue(groupMembership1.equals(groupMembership1)); assertTrue(groupMembership1.equals(groupMembership3)); }