|
24 | 24 | import java.util.LinkedList; |
25 | 25 | import java.util.List; |
26 | 26 | import java.util.NoSuchElementException; |
| 27 | +import java.util.Set; |
27 | 28 |
|
28 | 29 | import static io.microsphere.collection.CollectionUtils.addAll; |
29 | 30 | import static io.microsphere.collection.CollectionUtils.emptyIterable; |
|
35 | 36 | import static io.microsphere.collection.CollectionUtils.size; |
36 | 37 | import static io.microsphere.collection.CollectionUtils.toIterable; |
37 | 38 | import static io.microsphere.collection.Lists.ofList; |
| 39 | +import static io.microsphere.collection.SetUtils.newHashSet; |
38 | 40 | import static java.util.Collections.emptyEnumeration; |
39 | 41 | import static org.junit.jupiter.api.Assertions.assertEquals; |
40 | 42 | import static org.junit.jupiter.api.Assertions.assertFalse; |
@@ -167,11 +169,15 @@ public void testAddAll() { |
167 | 169 | assertEquals(0, addAll(values)); |
168 | 170 | assertEquals(2, addAll(values, "A", "B")); |
169 | 171 | assertEquals(ofList("A", "B"), values); |
| 172 | + |
| 173 | + Set<String> set = newHashSet(TEST_ELEMENT); |
| 174 | + assertEquals(0, addAll(set, TEST_ELEMENT)); |
170 | 175 | } |
171 | 176 |
|
172 | 177 | @Test |
173 | 178 | public void testFirst() { |
174 | 179 | assertNull(first(TEST_NULL_ITERATOR)); |
| 180 | + assertNull(first(TEST_EMPTY_QUEUE.iterator())); |
175 | 181 | assertNull(first(TEST_NULL_ITERABLE)); |
176 | 182 | assertNull(first(TEST_NULL_COLLECTION)); |
177 | 183 | assertNull(first(TEST_EMPTY_LIST)); |
|
0 commit comments