As previously, the code uses
List<String> names = Arrays.asList(...);
which yields an “array-backed list”, rather than
List<String> names = List.of(...);
which yields an immutable List, which is all we need.
As previously, the code uses
List<String> names = Arrays.asList(...);
which yields an “array-backed list”, rather than
List<String> names = List.of(...);
which yields an immutable List, which is all we need.