### Question:
Session { @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Session)) return false; Session session = (Session) o; if (serviceId != null ? !serviceId.equals(session.serviceId) : session.serviceId != null) return false; if (serviceName != null ? !serviceName.equals(session.serviceName) : session.serviceName != null) return false; if (serviceIcon != null ? !serviceIcon.equals(session.serviceIcon) : session.serviceIcon != null) return false; if (authRequest != null ? !authRequest.equals(session.authRequest) : session.authRequest != null) return false; return created != null ? created.equals(session.created) : session.created == null; } Session(UUID serviceId, String serviceName, URI serviceIcon, UUID authRequest, Date created); UUID getServiceId(); String getServiceName(); URI getServiceIcon(); UUID getAuthRequest(); Date getCreated(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void equalsTrueForSameValues() throws Exception { UUID id = UUID.randomUUID(); UUID auth = UUID.randomUUID(); URI icon = URI.create("http: Date created = new Date(123456L); assertTrue(new Session(id, "Name", icon, auth, created).equals(new Session(id, "Name", icon, auth, created))); }
@Test public void equalsFalseForDifferentServiceId() throws Exception { UUID id = UUID.randomUUID(); UUID auth = UUID.randomUUID(); URI icon = URI.create("http: Date created = new Date(123456L); assertFalse(new Session(id, "Name", icon, auth, created) .equals(new Session(UUID.randomUUID(), "Name", icon, auth, created))); }
@Test public void equalsFalseForDifferentServiceName() throws Exception { UUID id = UUID.randomUUID(); UUID auth = UUID.randomUUID(); URI icon = URI.create("http: Date created = new Date(123456L); assertFalse(new Session(id, "Name", icon, auth, created).equals(new Session(id, "Other", icon, auth, created))); }
@Test public void equalsNotTrueForDifferentServiceIcon() throws Exception { UUID id = UUID.randomUUID(); UUID auth = UUID.randomUUID(); URI icon = URI.create("http: Date created = new Date(123456L); assertFalse(new Session(id, "Name", icon, auth, created) .equals(new Session(id, "Name", URI.create("http: }
@Test public void equalsNotTrueForDifferentAuthRequest() throws Exception { UUID id = UUID.randomUUID(); UUID auth = UUID.randomUUID(); URI icon = URI.create("http: Date created = new Date(123456L); assertFalse(new Session(id, "Name", icon, auth, created) .equals(new Session(id, "Name", icon, UUID.randomUUID(), created))); }
@Test public void equalsNotTrueForDifferentCreated() throws Exception { UUID id = UUID.randomUUID(); UUID auth = UUID.randomUUID(); URI icon = URI.create("http: Date created = new Date(123456L); assertFalse(new Session(id, "Name", icon, auth, created) .equals(new Session(id, "Name", icon, auth, new Date(654321L)))); }