Collection
This is the most generic interface that is the base for all collections except Map. The documentation describes it as representing a collection of objects called elements. It declares the basic interface for all collections with the following most important methods:
add(Element): Adds an element to the collection
clear(): Removes all elements from the collection
contains(Object): Checks whether an object is in the collection
remove(Object): Removes the specified element from the collection, if present
size(): Returns the number of elements stored in the collection
List
The list interface represents a sequential collection of elements that can grow indefinitely. Elements in a list can be accessed by their index, which is the position that they were put in, but can change if elements are added between other elements.
When iterating over a list, the order that the elements will be fetched in is deterministic and will always be based on the order of their indexes, just like an array.
As we...