DefaultMapEntry implements Map.Entry<K, V> { @Override public int hashCode() { return (key == null ? 0 : key.hashCode()) ^ (value == null ? 0 : value.hashCode()); } DefaultMapEntry(K key, V value); K getKey(); V getValue(); V setValue(V value); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void hashCode_() { assertEquals(entry1.hashCode(), new DefaultMapEntry<String, Object>(null, null).hashCode()); assertEquals(entry2.hashCode(), new DefaultMapEntry<String, Object>("hello", "baobao").hashCode()); }