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,11 @@
|
||||
rangeClosed(1,100).sum() : 5050
|
||||
summaryStatistics : IntSummaryStatistics{count=8, sum=31, min=1, average=3.875000, max=9}
|
||||
mapToInt(length).sum() : 17
|
||||
average of empty IntStream : OptionalDouble.empty
|
||||
sum of empty IntStream : 0
|
||||
boxed().toList() : [1, 2, 3]
|
||||
IntStream sum overflow : -2147483648
|
||||
asLongStream sum : 2147483648
|
||||
Math.addExact in long : no overflow
|
||||
Math.addExact in int : integer overflow
|
||||
Stream<Integer>.reduce sum : -2147483648 <- also wraps
|
||||
Reference in New Issue
Block a user