I have a list of objects a List<B>
structure as follows:
class B {
int x;
String y;
}
Now I want to find last occurrence of a B object b such that b.x=1
. I
can do that by simply running a for loop and updating index for each
match. But how to do that in Java 8 I am not getting.
I saw there are
Java 8 APIs for findFirst()
and findAny()
, but did not find anything
similar for finding last occurrence.