Collection Design FAQ

Remi Forax forax at
Fri Sep 23 06:53:59 UTC 2016

On September 23, 2016 8:13:36 AM GMT+02:00, Kasper Nielsen <kasperni at> wrote:
>I accidently bumped into an old friend today
>There are couple of questions that might need an update after Java 8.

>Why don't you provide an "apply" method in Collection to apply a given
>method ("upcall") to all the elements of the Collection?

Take a look to Iterable.forEach

>Why didn't you provide a "Predicate" interface, and related methods
>a method to find the first element in the Collection satisfying the

predicate => java.util.function.Predicate ().filter(predicate).findFirst ()
(or findAny())

it's on Stream because you can choose if you want a parallel operation or not.

>  Kasper


Sent from my Android device with K-9 Mail. Please excuse my brevity.

More information about the core-libs-dev mailing list