AttributeImpl implements Attribute { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + name.hashCode(); result = prime * result + namespaceURI.hashCode(); result = prime * result + value.hashCode(); return result; } 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 testHashCode() { ConcreteAttributeImpl attr1 = new ConcreteAttributeImpl("ns", "pre", "name", "value"); ConcreteAttributeImpl attr2 = new ConcreteAttributeImpl("ns", "pre2", "name", "value"); assertEquals(new Integer(attr1.hashCode()), new Integer(attr2.hashCode())); }