Is stream().filter(xxx) "filter out" or "filter out" if xxx is true? Leave xxx as true

background

Sometimes looking at this code, it is a bit strange

list.stream().filter(xxx).map(yyy).collect(zzz);

Does this filter() "filter out" or "filter out" the xxx expression is true?

Conclusion : The xxx expression is true to stay.

Tucao: It's really easy to think that filtering out xxx is true, because filter makes people think of "filtering"

Replenish

Add some English phrases: about filter out sththe meaning of? We read some documents and sometimes come across this phrase, does this phrase mean "filter out sth" or "leave sth after filtering"?

filter out sthIt is a fixed collocation, which means "filter out sth". That is, sth should not be dropped, filtered out, and filtered out.

insert image description here

•  Children should have glasses which filter out UV rays. 
 孩子们应该佩戴可以滤除紫外线的眼镜。
•  Plants and trees filter carbon dioxide out of the air and produce oxygen. 
 植物和树木能滤除空气中的二氧化碳并制造出氧气。

Guess you like

Origin blog.csdn.net/w8y56f/article/details/131211700