Add convenience methods for e0().getKey(), etc., and migrate to them.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=78756685
diff --git a/guava-gwt/test-super/com/google/common/collect/testing/super/com/google/common/collect/testing/testers/MapCreationTester.java b/guava-gwt/test-super/com/google/common/collect/testing/super/com/google/common/collect/testing/testers/MapCreationTester.java
index a828028..93eec35 100644
--- a/guava-gwt/test-super/com/google/common/collect/testing/super/com/google/common/collect/testing/testers/MapCreationTester.java
+++ b/guava-gwt/test-super/com/google/common/collect/testing/super/com/google/common/collect/testing/testers/MapCreationTester.java
@@ -127,7 +127,7 @@
private Entry<K, V>[] getEntriesMultipleNonNullKeys() {
Entry<K, V>[] entries = createSamplesArray();
- entries[0] = entry(e1().getKey(), e0().getValue());
+ entries[0] = entry(k1(), v0());
return entries;
}
diff --git a/guava-gwt/test-super/com/google/common/collect/testing/super/com/google/common/collect/testing/testers/MapPutAllTester.java b/guava-gwt/test-super/com/google/common/collect/testing/super/com/google/common/collect/testing/testers/MapPutAllTester.java
index 9085f1d..3357792 100644
--- a/guava-gwt/test-super/com/google/common/collect/testing/super/com/google/common/collect/testing/testers/MapPutAllTester.java
+++ b/guava-gwt/test-super/com/google/common/collect/testing/super/com/google/common/collect/testing/testers/MapPutAllTester.java
@@ -53,8 +53,8 @@
@Override public void setUp() throws Exception {
super.setUp();
- containsNullKey = singletonList(entry(null, e3().getValue()));
- containsNullValue = singletonList(entry(e3().getKey(), null));
+ containsNullKey = singletonList(entry(null, v3()));
+ containsNullValue = singletonList(entry(k3(), null));
}
@MapFeature.Require(SUPPORTS_PUT)
diff --git a/guava-gwt/test-super/com/google/common/collect/testing/super/com/google/common/collect/testing/testers/MapPutTester.java b/guava-gwt/test-super/com/google/common/collect/testing/super/com/google/common/collect/testing/testers/MapPutTester.java
index aea0080..58f647a 100644
--- a/guava-gwt/test-super/com/google/common/collect/testing/super/com/google/common/collect/testing/testers/MapPutTester.java
+++ b/guava-gwt/test-super/com/google/common/collect/testing/super/com/google/common/collect/testing/testers/MapPutTester.java
@@ -50,10 +50,10 @@
@Override public void setUp() throws Exception {
super.setUp();
- nullKeyEntry = entry(null, e3().getValue());
- nullValueEntry = entry(e3().getKey(), null);
+ nullKeyEntry = entry(null, v3());
+ nullValueEntry = entry(k3(), null);
nullKeyValueEntry = entry(null, null);
- presentKeyNullValueEntry = entry(e0().getKey(), null);
+ presentKeyNullValueEntry = entry(k0(), null);
}
@MapFeature.Require(SUPPORTS_PUT)
@@ -117,7 +117,7 @@
public void testPut_unsupportedPresentExistingValue() {
try {
assertEquals("put(present, existingValue) should return present or throw",
- e0().getValue(), put(e0()));
+ v0(), put(e0()));
} catch (UnsupportedOperationException tolerated) {
}
expectUnchanged();
@@ -127,7 +127,7 @@
@CollectionSize.Require(absent = ZERO)
public void testPut_unsupportedPresentDifferentValue() {
try {
- getMap().put(e0().getKey(), e3().getValue());
+ getMap().put(k0(), v3());
fail("put(present, differentValue) should throw");
} catch (UnsupportedOperationException expected) {
}
@@ -143,7 +143,7 @@
@MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_KEYS})
@CollectionSize.Require(absent = ZERO)
public void testPut_nullKeySupportedPresent() {
- Entry<K, V> newEntry = entry(null, e3().getValue());
+ Entry<K, V> newEntry = entry(null, v3());
initMapWithNullKey();
assertEquals("put(present, value) should return the associated value",
getValueForNullKey(), put(newEntry));
@@ -187,7 +187,7 @@
@CollectionSize.Require(absent = ZERO)
public void testPut_replaceWithNullValueSupported() {
assertEquals("put(present, null) should return the associated value",
- e0().getValue(), put(presentKeyNullValueEntry));
+ v0(), put(presentKeyNullValueEntry));
expectReplacement(presentKeyNullValueEntry);
}
@@ -216,7 +216,7 @@
@MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_VALUES})
@CollectionSize.Require(absent = ZERO)
public void testPut_replaceNullValueWithNonNullSupported() {
- Entry<K, V> newEntry = entry(getKeyForNullValue(), e3().getValue());
+ Entry<K, V> newEntry = entry(getKeyForNullValue(), v3());
initMapWithNullValue();
assertNull("put(present, value) should return the associated value (null)",
put(newEntry));
diff --git a/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java b/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java
index 9d2339a..5d57ea1 100644
--- a/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java
+++ b/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java
@@ -228,4 +228,44 @@
protected void resetMap(Entry<K, V>[] entries) {
resetContainer(getSubjectGenerator().create((Object[]) entries));
}
+
+ protected final K k0() {
+ return e0().getKey();
+ }
+
+ protected final V v0() {
+ return e0().getValue();
+ }
+
+ protected final K k1() {
+ return e1().getKey();
+ }
+
+ protected final V v1() {
+ return e1().getValue();
+ }
+
+ protected final K k2() {
+ return e2().getKey();
+ }
+
+ protected final V v2() {
+ return e2().getValue();
+ }
+
+ protected final K k3() {
+ return e3().getKey();
+ }
+
+ protected final V v3() {
+ return e3().getValue();
+ }
+
+ protected final K k4() {
+ return e4().getKey();
+ }
+
+ protected final V v4() {
+ return e4().getValue();
+ }
}
diff --git a/guava-testlib/src/com/google/common/collect/testing/google/BiMapPutTester.java b/guava-testlib/src/com/google/common/collect/testing/google/BiMapPutTester.java
index f7bb1df..ab65169 100644
--- a/guava-testlib/src/com/google/common/collect/testing/google/BiMapPutTester.java
+++ b/guava-testlib/src/com/google/common/collect/testing/google/BiMapPutTester.java
@@ -34,9 +34,9 @@
@MapFeature.Require(SUPPORTS_PUT)
@CollectionSize.Require(ZERO)
public void testPutWithSameValueFails() {
- K k0 = e0().getKey();
- K k1 = e1().getKey();
- V v0 = e0().getValue();
+ K k0 = k0();
+ K k1 = k1();
+ V v0 = v0();
getMap().put(k0, v0);
try {
getMap().put(k1, v0);
@@ -52,9 +52,9 @@
@MapFeature.Require(SUPPORTS_PUT)
@CollectionSize.Require(ZERO)
public void testPutPresentKeyDifferentValue() {
- K k0 = e0().getKey();
- V v0 = e0().getValue();
- V v1 = e1().getValue();
+ K k0 = k0();
+ V v0 = v0();
+ V v1 = v1();
getMap().put(k0, v0);
getMap().put(k0, v1);
// verify that the bimap is changed, and that the old inverse mapping
@@ -66,8 +66,8 @@
@MapFeature.Require(SUPPORTS_PUT)
@CollectionSize.Require(ZERO)
public void putDistinctKeysDistinctValues() {
- getMap().put(e0().getKey(), e0().getValue());
- getMap().put(e1().getKey(), e1().getValue());
+ getMap().put(k0(), v0());
+ getMap().put(k1(), v1());
expectAdded(e0(), e1());
}
@@ -75,9 +75,9 @@
@MapFeature.Require(SUPPORTS_PUT)
@CollectionSize.Require(ZERO)
public void testForcePutOverwritesOldValueEntry() {
- K k0 = e0().getKey();
- K k1 = e1().getKey();
- V v0 = e0().getValue();
+ K k0 = k0();
+ K k1 = k1();
+ V v0 = v0();
getMap().put(k0, v0);
getMap().forcePut(k1, v0);
// verify that the bimap is unchanged
@@ -88,10 +88,10 @@
@MapFeature.Require(SUPPORTS_PUT)
@CollectionSize.Require(ZERO)
public void testInversePut() {
- K k0 = e0().getKey();
- V v0 = e0().getValue();
- K k1 = e1().getKey();
- V v1 = e1().getValue();
+ K k0 = k0();
+ V v0 = v0();
+ K k1 = k1();
+ V v1 = v1();
getMap().put(k0, v0);
getMap().inverse().put(v1, k1);
expectAdded(e0(), e1());
diff --git a/guava-testlib/src/com/google/common/collect/testing/google/BiMapRemoveTester.java b/guava-testlib/src/com/google/common/collect/testing/google/BiMapRemoveTester.java
index 01dcc24..8ba0ede 100644
--- a/guava-testlib/src/com/google/common/collect/testing/google/BiMapRemoveTester.java
+++ b/guava-testlib/src/com/google/common/collect/testing/google/BiMapRemoveTester.java
@@ -38,7 +38,7 @@
@MapFeature.Require(SUPPORTS_REMOVE)
@CollectionSize.Require(absent = ZERO)
public void testRemoveKeyRemovesFromInverse() {
- getMap().remove(e0().getKey());
+ getMap().remove(k0());
expectMissing(e0());
}
@@ -46,7 +46,7 @@
@MapFeature.Require(SUPPORTS_REMOVE)
@CollectionSize.Require(absent = ZERO)
public void testRemoveKeyFromKeySetRemovesFromInverse() {
- getMap().keySet().remove(e0().getKey());
+ getMap().keySet().remove(k0());
expectMissing(e0());
}
@@ -54,7 +54,7 @@
@MapFeature.Require(SUPPORTS_REMOVE)
@CollectionSize.Require(absent = ZERO)
public void testRemoveFromValuesRemovesFromInverse() {
- getMap().values().remove(e0().getValue());
+ getMap().values().remove(v0());
expectMissing(e0());
}
@@ -62,7 +62,7 @@
@MapFeature.Require(SUPPORTS_REMOVE)
@CollectionSize.Require(absent = ZERO)
public void testRemoveFromInverseRemovesFromForward() {
- getMap().inverse().remove(e0().getValue());
+ getMap().inverse().remove(v0());
expectMissing(e0());
}
@@ -70,7 +70,7 @@
@MapFeature.Require(SUPPORTS_REMOVE)
@CollectionSize.Require(absent = ZERO)
public void testRemoveFromInverseKeySetRemovesFromForward() {
- getMap().inverse().keySet().remove(e0().getValue());
+ getMap().inverse().keySet().remove(v0());
expectMissing(e0());
}
@@ -78,7 +78,7 @@
@MapFeature.Require(SUPPORTS_REMOVE)
@CollectionSize.Require(absent = ZERO)
public void testRemoveFromInverseValuesRemovesFromInverse() {
- getMap().inverse().values().remove(e0().getKey());
+ getMap().inverse().values().remove(k0());
expectMissing(e0());
}
diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapContainsKeyTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapContainsKeyTester.java
index 0271159..8c49b74 100644
--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapContainsKeyTester.java
+++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapContainsKeyTester.java
@@ -38,12 +38,12 @@
@CollectionSize.Require(absent = ZERO)
public void testContains_yes() {
assertTrue("containsKey(present) should return true",
- getMap().containsKey(e0().getKey()));
+ getMap().containsKey(k0()));
}
public void testContains_no() {
assertFalse("containsKey(notPresent) should return false",
- getMap().containsKey(e3().getKey()));
+ getMap().containsKey(k3()));
}
@MapFeature.Require(ALLOWS_NULL_KEY_QUERIES)
@@ -63,7 +63,7 @@
public void testContains_nonNullWhenNullContained() {
initMapWithNullKey();
assertFalse("containsKey(notPresent) should return false",
- getMap().containsKey(e3().getKey()));
+ getMap().containsKey(k3()));
}
@MapFeature.Require(ALLOWS_NULL_KEYS)
diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapContainsValueTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapContainsValueTester.java
index fb74536..492933d 100644
--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapContainsValueTester.java
+++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapContainsValueTester.java
@@ -38,12 +38,12 @@
@CollectionSize.Require(absent = ZERO)
public void testContains_yes() {
assertTrue("containsValue(present) should return true",
- getMap().containsValue(e0().getValue()));
+ getMap().containsValue(v0()));
}
public void testContains_no() {
assertFalse("containsValue(notPresent) should return false",
- getMap().containsValue(e3().getValue()));
+ getMap().containsValue(v3()));
}
@MapFeature.Require(ALLOWS_NULL_VALUE_QUERIES)
@@ -63,7 +63,7 @@
public void testContains_nonNullWhenNullContained() {
initMapWithNullValue();
assertFalse("containsValue(notPresent) should return false",
- getMap().containsValue(e3().getValue()));
+ getMap().containsValue(v3()));
}
@MapFeature.Require(ALLOWS_NULL_VALUES)
diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapCreationTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapCreationTester.java
index 25865d6..2369fca 100644
--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapCreationTester.java
+++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapCreationTester.java
@@ -130,7 +130,7 @@
private Entry<K, V>[] getEntriesMultipleNonNullKeys() {
Entry<K, V>[] entries = createSamplesArray();
- entries[0] = entry(e1().getKey(), e0().getValue());
+ entries[0] = entry(k1(), v0());
return entries;
}
diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapEntrySetTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapEntrySetTester.java
index 9bead7b..75663f0 100644
--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapEntrySetTester.java
+++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapEntrySetTester.java
@@ -63,18 +63,18 @@
public void testContainsEntryWithIncomparableKey() {
assertFalse(getMap()
- .entrySet().contains(Helpers.mapEntry(IncomparableType.INSTANCE, e0().getValue())));
+ .entrySet().contains(Helpers.mapEntry(IncomparableType.INSTANCE, v0())));
}
public void testContainsEntryWithIncomparableValue() {
assertFalse(getMap()
- .entrySet().contains(Helpers.mapEntry(e0().getKey(), IncomparableType.INSTANCE)));
+ .entrySet().contains(Helpers.mapEntry(k0(), IncomparableType.INSTANCE)));
}
@MapFeature.Require(ALLOWS_NULL_KEY_QUERIES)
public void testContainsEntryWithNullKeyAbsent() {
assertFalse(getMap()
- .entrySet().contains(Helpers.mapEntry(null, e0().getValue())));
+ .entrySet().contains(Helpers.mapEntry(null, v0())));
}
@CollectionSize.Require(absent = ZERO)
@@ -88,7 +88,7 @@
@MapFeature.Require(ALLOWS_NULL_VALUE_QUERIES)
public void testContainsEntryWithNullValueAbsent() {
assertFalse(getMap()
- .entrySet().contains(Helpers.mapEntry(e0().getKey(), null)));
+ .entrySet().contains(Helpers.mapEntry(k0(), null)));
}
@CollectionSize.Require(absent = ZERO)
diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapEqualsTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapEqualsTester.java
index fb9c787..021de68 100644
--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapEqualsTester.java
+++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapEqualsTester.java
@@ -59,7 +59,7 @@
@MapFeature.Require(ALLOWS_NULL_KEYS)
public void testEquals_containingNullKey() {
Collection<Map.Entry<K, V>> entries = getSampleEntries(getNumEntries() - 1);
- entries.add(entry(null, e3().getValue()));
+ entries.add(entry(null, v3()));
resetContainer(getSubjectGenerator().create(entries.toArray()));
assertTrue("A Map should equal any other Map containing the same entries,"
@@ -70,7 +70,7 @@
@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_otherContainsNullKey() {
Collection<Map.Entry<K, V>> entries = getSampleEntries(getNumEntries() - 1);
- entries.add(entry(null, e3().getValue()));
+ entries.add(entry(null, v3()));
Map<K, V> other = newHashMap(entries);
assertFalse(
@@ -83,7 +83,7 @@
@MapFeature.Require(ALLOWS_NULL_VALUES)
public void testEquals_containingNullValue() {
Collection<Map.Entry<K, V>> entries = getSampleEntries(getNumEntries() - 1);
- entries.add(entry(e3().getKey(), null));
+ entries.add(entry(k3(), null));
resetContainer(getSubjectGenerator().create(entries.toArray()));
assertTrue("A Map should equal any other Map containing the same entries,"
@@ -94,7 +94,7 @@
@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_otherContainsNullValue() {
Collection<Map.Entry<K, V>> entries = getSampleEntries(getNumEntries() - 1);
- entries.add(entry(e3().getKey(), null));
+ entries.add(entry(k3(), null));
Map<K, V> other = newHashMap(entries);
assertFalse(
diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapGetTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapGetTester.java
index 47180ad..8aa817d 100644
--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapGetTester.java
+++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapGetTester.java
@@ -39,11 +39,11 @@
@CollectionSize.Require(absent = ZERO)
public void testGet_yes() {
assertEquals("get(present) should return the associated value",
- e0().getValue(), get(e0().getKey()));
+ v0(), get(k0()));
}
public void testGet_no() {
- assertNull("get(notPresent) should return null", get(e3().getKey()));
+ assertNull("get(notPresent) should return null", get(k3()));
}
@MapFeature.Require(ALLOWS_NULL_KEY_QUERIES)
@@ -63,7 +63,7 @@
@CollectionSize.Require(absent = ZERO)
public void testGet_nonNullWhenNullContained() {
initMapWithNullKey();
- assertNull("get(notPresent) should return null", get(e3().getKey()));
+ assertNull("get(notPresent) should return null", get(k3()));
}
@MapFeature.Require(ALLOWS_NULL_KEYS)
diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapHashCodeTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapHashCodeTester.java
index d1d1d51..712b124 100644
--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapHashCodeTester.java
+++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapHashCodeTester.java
@@ -48,14 +48,14 @@
@CollectionSize.Require(absent = CollectionSize.ZERO)
@MapFeature.Require(ALLOWS_NULL_KEYS)
public void testHashCode_containingNullKey() {
- Map.Entry<K, V> entryWithNull = entry(null, e3().getValue());
+ Map.Entry<K, V> entryWithNull = entry(null, v3());
runEntryWithNullTest(entryWithNull);
}
@CollectionSize.Require(absent = CollectionSize.ZERO)
@MapFeature.Require(ALLOWS_NULL_VALUES)
public void testHashCode_containingNullValue() {
- Map.Entry<K, V> entryWithNull = entry(e3().getKey(), null);
+ Map.Entry<K, V> entryWithNull = entry(k3(), null);
runEntryWithNullTest(entryWithNull);
}
diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapPutAllTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapPutAllTester.java
index 8cf0f39..3bef211 100644
--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapPutAllTester.java
+++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapPutAllTester.java
@@ -56,8 +56,8 @@
@Override public void setUp() throws Exception {
super.setUp();
- containsNullKey = singletonList(entry(null, e3().getValue()));
- containsNullValue = singletonList(entry(e3().getKey(), null));
+ containsNullKey = singletonList(entry(null, v3()));
+ containsNullValue = singletonList(entry(k3(), null));
}
@MapFeature.Require(SUPPORTS_PUT)
diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapPutTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapPutTester.java
index 4772657..13ee949 100644
--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapPutTester.java
+++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapPutTester.java
@@ -53,10 +53,10 @@
@Override public void setUp() throws Exception {
super.setUp();
- nullKeyEntry = entry(null, e3().getValue());
- nullValueEntry = entry(e3().getKey(), null);
+ nullKeyEntry = entry(null, v3());
+ nullValueEntry = entry(k3(), null);
nullKeyValueEntry = entry(null, null);
- presentKeyNullValueEntry = entry(e0().getKey(), null);
+ presentKeyNullValueEntry = entry(k0(), null);
}
@MapFeature.Require(SUPPORTS_PUT)
@@ -120,7 +120,7 @@
public void testPut_unsupportedPresentExistingValue() {
try {
assertEquals("put(present, existingValue) should return present or throw",
- e0().getValue(), put(e0()));
+ v0(), put(e0()));
} catch (UnsupportedOperationException tolerated) {
}
expectUnchanged();
@@ -130,7 +130,7 @@
@CollectionSize.Require(absent = ZERO)
public void testPut_unsupportedPresentDifferentValue() {
try {
- getMap().put(e0().getKey(), e3().getValue());
+ getMap().put(k0(), v3());
fail("put(present, differentValue) should throw");
} catch (UnsupportedOperationException expected) {
}
@@ -146,7 +146,7 @@
@MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_KEYS})
@CollectionSize.Require(absent = ZERO)
public void testPut_nullKeySupportedPresent() {
- Entry<K, V> newEntry = entry(null, e3().getValue());
+ Entry<K, V> newEntry = entry(null, v3());
initMapWithNullKey();
assertEquals("put(present, value) should return the associated value",
getValueForNullKey(), put(newEntry));
@@ -190,7 +190,7 @@
@CollectionSize.Require(absent = ZERO)
public void testPut_replaceWithNullValueSupported() {
assertEquals("put(present, null) should return the associated value",
- e0().getValue(), put(presentKeyNullValueEntry));
+ v0(), put(presentKeyNullValueEntry));
expectReplacement(presentKeyNullValueEntry);
}
@@ -219,7 +219,7 @@
@MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_VALUES})
@CollectionSize.Require(absent = ZERO)
public void testPut_replaceNullValueWithNonNullSupported() {
- Entry<K, V> newEntry = entry(getKeyForNullValue(), e3().getValue());
+ Entry<K, V> newEntry = entry(getKeyForNullValue(), v3());
initMapWithNullValue();
assertNull("put(present, value) should return the associated value (null)",
put(newEntry));
diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapRemoveTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapRemoveTester.java
index 6568bbe..7cc960e 100644
--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapRemoveTester.java
+++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapRemoveTester.java
@@ -49,7 +49,7 @@
public void testRemove_present() {
int initialSize = getMap().size();
assertEquals("remove(present) should return the associated value",
- e0().getValue(), getMap().remove(e0().getKey()));
+ v0(), getMap().remove(k0()));
assertEquals("remove(present) should decrease a map's size by one.",
initialSize - 1, getMap().size());
expectMissing(e0());
@@ -61,7 +61,7 @@
public void testRemovePresentConcurrentWithEntrySetIteration() {
try {
Iterator<Entry<K, V>> iterator = getMap().entrySet().iterator();
- getMap().remove(e0().getKey());
+ getMap().remove(k0());
iterator.next();
fail("Expected ConcurrentModificationException");
} catch (ConcurrentModificationException expected) {
@@ -75,7 +75,7 @@
public void testRemovePresentConcurrentWithKeySetIteration() {
try {
Iterator<K> iterator = getMap().keySet().iterator();
- getMap().remove(e0().getKey());
+ getMap().remove(k0());
iterator.next();
fail("Expected ConcurrentModificationException");
} catch (ConcurrentModificationException expected) {
@@ -89,7 +89,7 @@
public void testRemovePresentConcurrentWithValuesIteration() {
try {
Iterator<V> iterator = getMap().values().iterator();
- getMap().remove(e0().getKey());
+ getMap().remove(k0());
iterator.next();
fail("Expected ConcurrentModificationException");
} catch (ConcurrentModificationException expected) {
@@ -100,7 +100,7 @@
@MapFeature.Require(SUPPORTS_REMOVE)
public void testRemove_notPresent() {
assertNull("remove(notPresent) should return null",
- getMap().remove(e3().getKey()));
+ getMap().remove(k3()));
expectUnchanged();
}
@@ -121,13 +121,13 @@
@CollectionSize.Require(absent = ZERO)
public void testRemove_unsupported() {
try {
- getMap().remove(e0().getKey());
+ getMap().remove(k0());
fail("remove(present) should throw UnsupportedOperationException");
} catch (UnsupportedOperationException expected) {
}
expectUnchanged();
assertEquals("remove(present) should not remove the element",
- e0().getValue(), get(e0().getKey()));
+ v0(), get(k0()));
}
@MapFeature.Require(absent = SUPPORTS_REMOVE)
@@ -135,7 +135,7 @@
try {
assertNull("remove(notPresent) should return null or throw "
+ "UnsupportedOperationException",
- getMap().remove(e3().getKey()));
+ getMap().remove(k3()));
} catch (UnsupportedOperationException tolerated) {
}
expectUnchanged();
diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/NavigableMapNavigationTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/NavigableMapNavigationTester.java
index 912d2d7..dbb3489 100644
--- a/guava-testlib/src/com/google/common/collect/testing/testers/NavigableMapNavigationTester.java
+++ b/guava-testlib/src/com/google/common/collect/testing/testers/NavigableMapNavigationTester.java
@@ -88,14 +88,14 @@
@CollectionSize.Require(ZERO)
public void testEmptyMapNearby() {
- assertNull(navigableMap.lowerEntry(e0().getKey()));
- assertNull(navigableMap.lowerKey(e0().getKey()));
- assertNull(navigableMap.floorEntry(e0().getKey()));
- assertNull(navigableMap.floorKey(e0().getKey()));
- assertNull(navigableMap.ceilingEntry(e0().getKey()));
- assertNull(navigableMap.ceilingKey(e0().getKey()));
- assertNull(navigableMap.higherEntry(e0().getKey()));
- assertNull(navigableMap.higherKey(e0().getKey()));
+ assertNull(navigableMap.lowerEntry(k0()));
+ assertNull(navigableMap.lowerKey(k0()));
+ assertNull(navigableMap.floorEntry(k0()));
+ assertNull(navigableMap.floorKey(k0()));
+ assertNull(navigableMap.ceilingEntry(k0()));
+ assertNull(navigableMap.ceilingKey(k0()));
+ assertNull(navigableMap.higherEntry(k0()));
+ assertNull(navigableMap.higherKey(k0()));
}
@CollectionSize.Require(ZERO)
@@ -123,14 +123,14 @@
@CollectionSize.Require(ONE)
public void testSingletonMapNearby() {
- assertNull(navigableMap.lowerEntry(e0().getKey()));
- assertNull(navigableMap.lowerKey(e0().getKey()));
- assertEquals(a, navigableMap.floorEntry(e0().getKey()));
- assertEquals(a.getKey(), navigableMap.floorKey(e0().getKey()));
- assertEquals(a, navigableMap.ceilingEntry(e0().getKey()));
- assertEquals(a.getKey(), navigableMap.ceilingKey(e0().getKey()));
- assertNull(navigableMap.higherEntry(e0().getKey()));
- assertNull(navigableMap.higherKey(e0().getKey()));
+ assertNull(navigableMap.lowerEntry(k0()));
+ assertNull(navigableMap.lowerKey(k0()));
+ assertEquals(a, navigableMap.floorEntry(k0()));
+ assertEquals(a.getKey(), navigableMap.floorKey(k0()));
+ assertEquals(a, navigableMap.ceilingEntry(k0()));
+ assertEquals(a.getKey(), navigableMap.ceilingKey(k0()));
+ assertNull(navigableMap.higherEntry(k0()));
+ assertNull(navigableMap.higherKey(k0()));
}
@CollectionSize.Require(ONE)