aboutsummaryrefslogtreecommitdiffstats
path: root/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java
diff options
context:
space:
mode:
Diffstat (limited to 'guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java')
-rw-r--r--guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java16
1 files changed, 6 insertions, 10 deletions
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 b86c61a..c8c3169 100644
--- a/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java
+++ b/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java
@@ -16,8 +16,6 @@
package com.google.common.collect.testing;
-import com.google.common.annotations.GwtCompatible;
-
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
@@ -38,7 +36,6 @@ import java.util.Map.Entry;
*
* @author George van den Driessche
*/
-@GwtCompatible
public abstract class AbstractMapTester<K, V> extends
AbstractContainerTester<Map<K, V>, Map.Entry<K, V>> {
protected Map<K, V> getMap() {
@@ -175,16 +172,15 @@ public abstract class AbstractMapTester<K, V> extends
for (Entry<K, V> entry : entries) {
assertFalse("Should not contain entry " + entry,
actualContents().contains(entry));
- assertFalse("Should not contain key " + entry.getKey() + " mapped to"
- + " value " + entry.getValue(),
- equal(getMap().get(entry.getKey()), entry.getValue()));
+ assertFalse("Should not contain key " + entry.getKey(),
+ getMap().containsKey(entry.getKey()));
+ assertFalse("Should not contain value " + entry.getValue(),
+ getMap().containsValue(entry.getValue()));
+ assertNull("Should not return a mapping for key " + entry.getKey(),
+ getMap().get(entry.getKey()));
}
}
- private static boolean equal(Object a, Object b) {
- return a == b || (a != null && a.equals(b));
- }
-
// This one-liner saves us from some ugly casts
protected Entry<K, V> entry(K key, V value) {
return Helpers.mapEntry(key, value);