Java 8 : How to use findFirst() in Streams API?

You can use this to do any interaction and break the process when find the first conditional.


Optional<Plate> myFirstVegetarianOptional = 
menu.getAllPlates().stream().filter(a ->

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s