AttributeImpl implements Attribute { public Object clone() { try { AttributeImpl clone = (AttributeImpl) super.clone(); clone.owner = null; return clone; } catch (CloneNotSupportedException e) { throw new AssertionError(e); } } 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 testClone() { ConcreteAttributeImpl attr = new ConcreteAttributeImpl("ns", "pre", "name", "value"); ConcreteElementImpl elem = new ConcreteElementImpl("ns", "pre", "name"); attr.setOwner(elem); ConcreteAttributeImpl cattr = attr.clone(); assertNull(cattr.getOwnerElement()); assertEquals(attr, cattr); assertNotSame(attr, cattr); }