Item implements Serializable { @Override public boolean equals(Object obj) { if (obj != null && obj instanceof Item) { return name.equals(((Item) obj).name); } return false; } Item(String name, List<Attribute> attributes);  Item(); String getName(); void setName(String name); List<Attribute> getAttributes(); void setAttributes(List<Attribute> attributes); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testEquals_1() throws Exception { Item fixture = new Item("", new LinkedList()); Object obj = new Item("", new LinkedList()); boolean result = fixture.equals(obj); assertEquals(true, result); }
@Test public void testEquals_2() throws Exception { Item fixture = new Item("", new LinkedList()); Object obj = new Item("", new LinkedList()); boolean result = fixture.equals(obj); assertEquals(true, result); }
@Test public void testEquals_3() throws Exception { Item fixture = new Item("", new LinkedList()); Object obj = null; boolean result = fixture.equals(obj); assertEquals(false, result); }
@Test public void testEquals_4() throws Exception { Item fixture = new Item("", new LinkedList()); Object obj = new Object(); boolean result = fixture.equals(obj); assertEquals(false, result); }