Re-add non-comparable key tests to LinkedHashTreeMap.
This commit is contained in:
parent
c22ab9767d
commit
83e1f45653
@ -59,6 +59,20 @@ public final class LinkedHashTreeMapTest extends TestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testPutNonComparableKeyFails() {
|
||||
LinkedHashTreeMap<Object, String> map = new LinkedHashTreeMap<Object, String>();
|
||||
try {
|
||||
map.put(new Object(), "android");
|
||||
} catch (ClassCastException expected) {}
|
||||
}
|
||||
|
||||
@SuppressWarnings("SuspiciousMethodCalls")
|
||||
public void testContainsNonComparableKeyReturnsFalse() {
|
||||
LinkedHashTreeMap<String, String> map = new LinkedHashTreeMap<String, String>();
|
||||
map.put("a", "android");
|
||||
assertFalse(map.containsKey(new Object()));
|
||||
}
|
||||
|
||||
public void testContainsNullKeyFails() {
|
||||
LinkedHashTreeMap<String, String> map = new LinkedHashTreeMap<String, String>();
|
||||
map.put("a", "android");
|
||||
|
Loading…
Reference in New Issue
Block a user