streams: Java Stream API + Collectors cookbook module (creation, laziness and short-circuiting, intermediate/terminal ops, Collectors recipes and toMap traps, primitive stream overflow, parallel traps, Gatherers on JDK 25, loop-to-stream conversion), 12 contract tests
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b49nGy7tcEjVUa3WAA
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
reduce(0, Integer::sum) : 15
|
||||
reduce((a,b) -> a*b) : Optional[120]
|
||||
reduce on empty stream : Optional.empty
|
||||
reduce("", join) : Java Streams are powerful
|
||||
anyMatch even : true
|
||||
allMatch positive : true
|
||||
noneMatch negative : true
|
||||
allMatch on empty stream : true <- vacuously true
|
||||
findFirst(n > 5) : Optional[7]
|
||||
count / min / max : 6 / Optional[1] / Optional[9]
|
||||
Collectors.toList() then add: [1, 2, 3, 4]
|
||||
Stream.toList() then add : UnsupportedOperationException
|
||||
toList() allows null elements: [a, null]
|
||||
List.of(...) allows null : NullPointerException
|
||||
Reference in New Issue
Block a user