...
An important observation as to why this solution will achieve O(1) constant space complexity is that the streams will not be terminated until they leave the Rest controller.
Streaming all the way
This will require adding Stream versions of CPS Core read operations, e.g.
...