@Test public void entry_hashCodeForNullKeyAndValue() { MutableMap<Integer, String> map = this.newMapWithKeyValue(null, null); Map.Entry<Integer, String> entry = Iterate.getFirst(map.entrySet()); Assert.assertEquals(0, entry.hashCode()); }
@Test public void entry_equalsWithNonEntry() { MutableMap<Integer, String> map = this.newMapWithKeyValue(null, null); Map.Entry<Integer, String> entry = Iterate.getFirst(map.entrySet()); Verify.assertNotEquals(entry, new Object()); }
@Test public void entry_setValue() { MutableMap<Integer, String> map = this.newMapWithKeyValue(1, "One"); Map.Entry<Integer, String> entry = Iterate.getFirst(map.entrySet()); String value = "Ninety-Nine"; Assert.assertEquals("One", entry.setValue(value)); Assert.assertEquals(value, entry.getValue()); Verify.assertContainsKeyValue(1, value, map); map.remove(1); Verify.assertEmpty(map); Assert.assertNull(entry.setValue("Ignored")); }