List newList = iList.stream().filter(x->x>3).filter(p).collect(Collectors.toList());
Something is wired in the explanation:
The first filter is x>3. Predicate p is the second filter. Your explanation says that p is the first filter and x>3 is the second filter.
This means first 1, 2 and 3 are out. Next 5 and 7 get filtered.
Cheers
About Question enthuware.ocpjp.v8.2.1820 :
Moderators: Site Manager, fjwalraven
-
- Posts: 13
- Joined: Mon Apr 18, 2016 2:05 pm
- Contact:
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1820 :
You are right. The order should be reversed. Fixed.
thank you for your feedback!
Paul.
thank you for your feedback!
Paul.
Who is online
Users browsing this forum: No registered users and 5 guests