Inserts all of the elements in the specified collection into this list at the specified position.
Inserts all of the elements in the specified collection into this list at the specified position.Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in this list in the order that they are returned by the specified collection's iterator.
The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)
For array lists adding to the end of the list has a time complexity of O(M), while adding to the beginning of the list has a time complexity of O(N + M) with N being the number of elements in the list and M being the size of the collection whose elements are added.
For linked lists adding to beginning or the end of the list has a time complexity of O(M), while adding to a random position in the middle of the list has a time complexity of O(N + M) with N being the number of elements in the list and M being the size of the collection whose elements are added.