Tests whether this Collection contains all objects contained in the specified Collection. This implementation iterates over the specified Collection. If one element returned by the iterator is not contained in this Collection, then false is returned; {@code tr
(Collection<?> collection)
| 163 | * if {@code collection} is {@code null}. |
| 164 | */ |
| 165 | public boolean containsAll(Collection<?> collection) { |
| 166 | Iterator<?> it = collection.iterator(); |
| 167 | while (it.hasNext()) { |
| 168 | if (!contains(it.next())) { |
| 169 | return false; |
| 170 | } |
| 171 | } |
| 172 | return true; |
| 173 | } |
| 174 | |
| 175 | /** |
| 176 | * Returns if this {@code Collection} contains no elements. This implementation |