Modern Java in Action 3 - collection API
New API (in Java 8) Collection classes got a few nice additions.
Factory methods They create immutable collection (if you try to add/remove elements, you get UnsupportedOperationException. There is no varargs variant - this variant would require additional array allocation, which non-varargs variants don’t have.
There are overloads from 1 to 10 elements.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 //static <E> List<E> of(E.