, -, @ZhekaKozlov @GhostCat (ImmutableCollections.List), , API. , factory , List.
ImmutableCollections, , . List, Map Set.
ImmutableCollections factory List, :
abstract static class AbstractImmutableList<E>
AbstractList UnsupportedOperationException , . , , Java .
,
static final class ListN<E> extends AbstractImmutableList<E>
NonNull, , E[] elements ( E), .get(int idx), .contains(Object o) .
, Map Set, , . , ( IllegalArgumentException NullPointer ):
Set<String> set2 = Set.of("a", "b", "a");
Map<String,String> map = Map.of("key1","value1","key1","value1");
Set<String> set2 = Set.of("a", null);
Map<String,String> map = Map.of("key1",null);