Skip to content

Commit f913c87

Browse files
committed
Update CollectionUtilsTest.java
1 parent 01a31cd commit f913c87

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

microsphere-java-core/src/test/java/io/microsphere/collection/CollectionUtilsTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.LinkedList;
2525
import java.util.List;
2626
import java.util.NoSuchElementException;
27+
import java.util.Set;
2728

2829
import static io.microsphere.collection.CollectionUtils.addAll;
2930
import static io.microsphere.collection.CollectionUtils.emptyIterable;
@@ -35,6 +36,7 @@
3536
import static io.microsphere.collection.CollectionUtils.size;
3637
import static io.microsphere.collection.CollectionUtils.toIterable;
3738
import static io.microsphere.collection.Lists.ofList;
39+
import static io.microsphere.collection.SetUtils.newHashSet;
3840
import static java.util.Collections.emptyEnumeration;
3941
import static org.junit.jupiter.api.Assertions.assertEquals;
4042
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -167,11 +169,15 @@ public void testAddAll() {
167169
assertEquals(0, addAll(values));
168170
assertEquals(2, addAll(values, "A", "B"));
169171
assertEquals(ofList("A", "B"), values);
172+
173+
Set<String> set = newHashSet(TEST_ELEMENT);
174+
assertEquals(0, addAll(set, TEST_ELEMENT));
170175
}
171176

172177
@Test
173178
public void testFirst() {
174179
assertNull(first(TEST_NULL_ITERATOR));
180+
assertNull(first(TEST_EMPTY_QUEUE.iterator()));
175181
assertNull(first(TEST_NULL_ITERABLE));
176182
assertNull(first(TEST_NULL_COLLECTION));
177183
assertNull(first(TEST_EMPTY_LIST));

0 commit comments

Comments
 (0)