MetadataElement implements NameValuePair, Cloneable { @Override public int hashCode() { return getKey().hashCode(); } MetadataElement();  MetadataElement(KeyValuePair kp);  MetadataElement(String key, String value); @Override void setKey(String key); @Override String getKey(); @Override void setValue(String value); @Override String getValue(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone();  }
@Test public void testHashCode() { assertTrue(me1.hashCode() == me2.hashCode()); assertTrue(me1.hashCode() == me3.hashCode()); assertTrue(!(me1.hashCode() == me4.hashCode())); }