test/java/util/Collection/MOAT.java
Print this page
rev 7932 : 8021591: Additional explicit null checks
Reviewed-by: psandoz, martin, alanb
@@ -398,12 +398,10 @@
//----------------------------------------------------------------
// If add(null) succeeds, contains(null) & remove(null) should succeed
//----------------------------------------------------------------
private static void testNullElement(Collection<Integer> c) {
- // !!!! 5018849: (coll) TreeSet.contains(null) does not agree with Javadoc
- if (c instanceof TreeSet) return;
try {
check(c.add(null));
if (c.size() == 1)
equal(c.toString(), "[null]");