Attribute implements Serializable { @Override public boolean equals(Object obj) { if (obj != null && obj instanceof Attribute) { Attribute o = (Attribute) obj; return new EqualsBuilder().append(name, o.name).append(value, o.value).isEquals(); } return false; } Attribute();  Attribute(String name, String value); String getName(); void setName(String name); String getValue(); void setValue(String value); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testEquals_1() throws Exception { Attribute fixture = new Attribute("", ""); Object obj = new Attribute("", ""); boolean result = fixture.equals(obj); assertEquals(true, result); }
@Test public void testEquals_2() throws Exception { Attribute fixture = new Attribute("", ""); Object obj = new Attribute("", ""); boolean result = fixture.equals(obj); assertEquals(true, result); }
@Test public void testEquals_3() throws Exception { Attribute fixture = new Attribute("", ""); Object obj = null; boolean result = fixture.equals(obj); assertEquals(false, result); }
@Test public void testEquals_4() throws Exception { Attribute fixture = new Attribute("", ""); Object obj = new Object(); boolean result = fixture.equals(obj); assertEquals(false, result); }