DefaultMapEntry implements Map.Entry<K, V> { public V setValue(V value) { V oldValue = this.value; this.value = value; return oldValue; } 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 setValue() { DefaultMapEntry<String, Object> entry = new DefaultMapEntry<String, Object>(null, null); assertEquals(null, entry.setValue("hello")); assertEquals("hello", entry.getValue()); }