Functional Programming in Java, Second Edition: p. 130 "LazyStreams.java"

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.

Fixed. Thank you.

1 Like