Inserts the specified element into the underlying collection.
Inserts the specified element into the underlying collection.The element is inserted immediately before the next element that would be returned by next, if any, and after the next element that would be returned by previous, if any.
If the list contains no elements, the new element becomes the sole element on the list.
The new element is inserted before the implicit cursor: a subsequent call to next would be unaffected, and a subsequent call to previous would return the new element. This call increases by one the value that would be returned by a call to nextIndex or previousIndex.
For array lists this method has a time complexity of O(N), with N being the number of elements in the underlying list.
For linked lists this method has a time complexity of O(1).