AttributeImpl implements Attribute { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof AttributeImpl)) return false; AttributeImpl other = (AttributeImpl) obj; if (!name.equals(other.name)) return false; if (!namespaceURI.equals(other.namespaceURI)) return false; if (!value.equals(other.value)) return false; return true; } protected  AttributeImpl(String namespaceURI, String prefix, String name,
			String value); String getNamespaceUri(); String getPrefix(); String getName(); String getValue(); void setOwner(Element owner); Element getOwnerElement(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); Object clone();  }
@Test public void testEqualsObject() { ConcreteAttributeImpl attr1 = new ConcreteAttributeImpl("ns", "pre", "name", "value"); ConcreteAttributeImpl attr2 = new ConcreteAttributeImpl("ns", "pre2", "name", "value"); ConcreteAttributeImpl attr3 = new ConcreteAttributeImpl("ns2", "pre", "name", "value"); ConcreteAttributeImpl attr4 = new ConcreteAttributeImpl("ns", "pre", "name2", "value"); ConcreteAttributeImpl attr5 = new ConcreteAttributeImpl("ns", "pre", "name", "value2"); assertEquals(attr1, attr1); assertEquals(attr1, attr2); assertFalse(attr1.equals(attr3)); assertFalse(attr1.equals(attr4)); assertFalse(attr1.equals(attr5)); assertFalse(attr1.equals(null)); assertFalse(attr1.equals(new Object())); }