Adds all elements in iterable to collection. @return true if collection was modified as a result of this operation.
(Collection<T> addTo, Iterable<? extends T> elementsToAdd)
| 375 | */ |
| 376 | |
| 377 | @CanIgnoreReturnValue |
| 378 | public static <T> boolean addAll(Collection<T> addTo, Iterable<? extends T> elementsToAdd) { |
| 379 | if (elementsToAdd instanceof Collection) { |
| 380 | Collection<? extends T> c = Collections2.cast(elementsToAdd); |
| 381 | return addTo.addAll(c); |
| 382 | } |
| 383 | return Iterators.addAll(addTo, checkNotNull(elementsToAdd).iterator()); |
| 384 | } |
| 385 | |
| 386 | /** |
| 387 | * Returns the number of elements in the specified iterable that equal the |
no test coverage detected