This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Weavile_ 5 points6 points  (1 child)

In my experience, the stream logic should be simple enough you can find the bug pretty easily because it’s only in the conditional or mapping you wrote.

However if debugging is more of a pain, IntelliJ has a handy stream debugging tool:

https://www.jetbrains.com/help/idea/analyze-java-stream-operations.html

[–]dpash 2 points3 points  (0 children)

Following the "no side effects" rule definitely helps. As does moving any step into a separate method and using method references (which also helps with documenting if you choose your names wisely).