addAll
AddAll is a common operation in collection libraries that copies all elements from one collection into another. It is designed to merge two collections efficiently by appending the contents of the source collection to the end of the destination collection, preserving the source order for elements.
In the Java Collections Framework, addAll is defined on the Collection interface as boolean addAll(Collection<? extends
Null handling and errors: The method throws NullPointerException if the input collection is null. If the destination
Semantics: addAll does not remove elements from the source or perform deduplication; the resulting collection contains
Complexity and considerations: The operation is typically linear in the number of added elements. Some implementations
Other languages: In Kotlin, addAll functions similarly; in Python, the equivalent concepts are extend (for lists)