diff --git a/collectionutils/pom.xml b/collectionutils/pom.xml
index 6d05375efe..810f53847d 100644
--- a/collectionutils/pom.xml
+++ b/collectionutils/pom.xml
@@ -17,7 +17,7 @@
org.apache.commons
commons-collections4
- 4.0
+ 4.1
diff --git a/collectionutils/src/test/java/collectionutils/CollectionUtilsGuideTest.java b/collectionutils/src/test/java/collectionutils/CollectionUtilsGuideTest.java
index 0913a56c9d..af925778b8 100644
--- a/collectionutils/src/test/java/collectionutils/CollectionUtilsGuideTest.java
+++ b/collectionutils/src/test/java/collectionutils/CollectionUtilsGuideTest.java
@@ -35,9 +35,8 @@ public class CollectionUtilsGuideTest {
@Test
public void givenList_WhenAddIgnoreNull_thenNoNullAdded() {
- List list = Arrays.asList("x", "y", "z");
- CollectionUtils.addIgnoreNull(list, null);
- assertFalse(list.contains(null));
+ CollectionUtils.addIgnoreNull(list1, null);
+ assertFalse(list1.contains(null));
}
@Test
@@ -98,14 +97,15 @@ public class CollectionUtilsGuideTest {
}
@Test
- public void givenEmptyList_WhenCheckedIsEmpty_thenTrue() {
+ public void givenNonEmptyList_WhenCheckedIsNotEmpty_thenTrue() {
List emptyList = new ArrayList();
List nullList = null;
//Very handy at times where we want to check if a collection is not null and not empty too.
//isNotEmpty does the opposite. Handy because using ! operator on isEmpty makes it missable while reading
- assertTrue(CollectionUtils.isEmpty(emptyList));
+ assertTrue(CollectionUtils.isNotEmpty(list1));
assertTrue(CollectionUtils.isEmpty(nullList));
+ assertTrue(CollectionUtils.isEmpty(emptyList));
}
@Test