TextImpl extends NodeImpl implements Text { @Override public int hashCode() { return text.hashCode(); } TextImpl(String text); @Override org.w3c.dom.Text asXmlNode(Document document); String getText(); String getPlainText(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void testHashCode() { TextImpl text1 = new TextImpl("abc"); TextImpl text2 = new TextImpl("abc"); assertEquals(new Integer(text1.hashCode()), new Integer(text2 .hashCode())); }