### Question:
MailItem { @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof MailItem)) return false; MailItem item = (MailItem) o; if (id != null ? !id.equals(item.id) : item.id != null) return false; if (title != null ? !title.equals(item.title) : item.title != null) return false; if (body != null ? !body.equals(item.body) : item.body != null) return false; if (attachments != null ? !attachments.equals(item.attachments) : item.attachments != null) return false; if (sender != null ? !sender.equals(item.sender) : item.sender != null) return false; if (receivers != null ? !receivers.equals(item.receivers) : item.receivers != null) return false; if (event != null ? !event.equals(item.event) : item.event != null) return false; return headers != null ? headers.equals(item.headers) : item.headers == null; } MailItem();  MailItem(String title, String body, DataSource attachments, String sender, String... receivers);  MailItem(String title, String body, DataSource attachments, String sender, List<String> receivers);  MailItem(String title, String body, List<DataSource> attachments, String sender, String... receivers);  MailItem(String title, String body, List<DataSource> attachments, String sender, List<String> receivers); String getId(); void setId(String id); String getTitle(); void setTitle(String title); String getBody(); void setBody(String body); List<DataSource> getAttachments(); void setAttachments(List<DataSource> attachments); String getSender(); void setSender(String sender); List<String> getReceivers(); void setReceivers(String... receivers); void setReceivers(List<String> receivers); MailEvent getEvent(); void setEvent(MailEvent event); Map<String, String[]> getHeaders(); void setHeaders(Map<String, String[]> headers); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void equalsTest(){ MailItem item1 = new MailItem("title", "body", (DataSource) null, "sender", "receiver"); assertEquals(item1, item1); Object item2 = new Object(); assertNotEquals(item1,item2); }