Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
CollectionBag.add(E):
Using "(Integer) null" as parameter the method throws a "NullPointerException", but not described into the specification.
CollectionBag.add(E, int):
A "ClassCastException" can be generated, but not described into the specification.
Test used:
public class CollectionBag_4_failure_Test{ public void testAdd_Always() throws Throwable { TreeBag<Predicate<Object>> treeBag0 = new TreeBag<Predicate<Object>>(); CollectionBag<Predicate<Object>> collectionBag0 = new CollectionBag<Predicate<Object>>(treeBag0); Predicate<Object> predicate0 = NonePredicate.nonePredicate((Collection<? extends Predicate<? super Object>>) collectionBag0); try { boolean _methodResult__ = collectionBag0.add(predicate0, 24); org.junit.Assert.assertTrue(_methodResult__ == true); } catch (ClassCastException e) { verifyException("java.util.TreeMap", e); org.junit.Assert.fail(); } } }