Know Your Java?
summary
Concrete surprises and concrete fixes: using remove(int) vs remove(Object) with Integer autoboxing makes the same call remove by index on a List but remove by value when the variable is a Collection, producing [1,3] or [2,3]. var infers concrete type so var numbers = new ArrayList<>(...) yields ArrayList behavior, not a Collection. arraysAsList is fixed-size (add throws, set works); prefer List.of for immutable collections. Stream collectors differ (Collectors.toList mutable vs stream.toList immutable). Parallel streams or lazy streams break code with side effects or externally mutated state.
AI-written summary · about
chapters (11)
- 0:00Java surprises
- 3:18Compiler vs unit tests
- 5:07List vs Collection remove
- 10:28Type inference dangers
- 15:27Functional Programming mistakes
- 16:32Arrays.asList pitfalls
- 22:54Failing production code
- 25:22Stream side effects
- 31:28Pure functions in streams
- 35:22Lazy evaluation in streams
- 39:39Purity and immutability in Java








