Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • While this seems correct and may be good advice, this does not answer the question asked, which is about transformation/map. Commented Aug 21, 2023 at 19:23
  • 1
    @PhilippeCloutier I edited my answer to use the doSomething() method that appears in the original question, to clarify that collectIf() does transform/map in addition to filtering. Commented Aug 25, 2023 at 1:23
  • Ah, I see now. I submitted an edit to clarify that this addresses the OP's specific problem. Commented Aug 25, 2023 at 17:52