Remarks
Starting from this article, I will only record what I think is important to myself, not what is important to readers, because you can't do me any favors!
Preface
IDEA's support for Stream is actually very complete. We can debug the Stream to view the specific processing process and results of the stream data.
start
Let's first put a breakpoint on the line that converts the collection or array into a stream object, as shown in the figure:
Then click debug to run, as shown in the figure:
Click the button in the picture above to Trace Current Stream Chain
open the Stream data processing interface, as shown in the picture:
There is nothing when we first come in, because we need to get the data first. After we wait for a while, we can see the initial data, as shown in the figure:
What operations we have performed on the data will be displayed on the interface. By clicking each button, we can view the data before this operation and the result data after the operation. It is very clear:
Other operations are similar, so I won’t go into details here!