test/java/util/Collection/MOAT.java

Print this page
rev 7682 : 8021591: Additional explicit null checks
Reviewed-by: duke

*** 399,410 **** //---------------------------------------------------------------- // 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]"); --- 399,408 ----