diff --git a/src/main/java/org/apache/commons/collections4/functors/AllPredicate.java b/src/main/java/org/apache/commons/collections4/functors/AllPredicate.java index a76cb2157..d16f1a73f 100644 --- a/src/main/java/org/apache/commons/collections4/functors/AllPredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/AllPredicate.java @@ -46,6 +46,7 @@ public final class AllPredicate extends AbstractQuantifierPredicate { *

* If the collection is size zero, the predicate always returns true. * If the collection is size one, then that predicate is returned. + *

* * @param the type that the predicate queries * @param predicates the predicates to check, cloned, not null @@ -69,6 +70,7 @@ public final class AllPredicate extends AbstractQuantifierPredicate { *

* If the array is size zero, the predicate always returns true. * If the array is size one, then that predicate is returned. + *

* * @param the type that the predicate queries * @param predicates the predicates to check, cloned, not null diff --git a/src/test/java/org/apache/commons/collections4/bag/CollectionBagTest.java b/src/test/java/org/apache/commons/collections4/bag/CollectionBagTest.java index de7aa4598..bd6829b72 100644 --- a/src/test/java/org/apache/commons/collections4/bag/CollectionBagTest.java +++ b/src/test/java/org/apache/commons/collections4/bag/CollectionBagTest.java @@ -26,7 +26,9 @@ import java.util.Arrays; import java.util.Collection; import org.apache.commons.collections4.Bag; +import org.apache.commons.collections4.Predicate; import org.apache.commons.collections4.collection.AbstractCollectionTest; +import org.apache.commons.collections4.functors.NonePredicate; import org.junit.jupiter.api.Test; /** @@ -37,6 +39,14 @@ import org.junit.jupiter.api.Test; */ public class CollectionBagTest extends AbstractCollectionTest { + @Test + public void testAdd_Always() throws Throwable { + TreeBag> treeBagOfPredicateOfObject = new TreeBag<>(); + CollectionBag> collectionBagOfPredicateOfObject = new CollectionBag<>(treeBagOfPredicateOfObject); + Predicate predicate0 = NonePredicate.nonePredicate(collectionBagOfPredicateOfObject); + collectionBagOfPredicateOfObject.add(predicate0, 24); + } + /** * JUnit constructor. */