I have a list of object and I want to find the index of an element with a specific attribute value.
Such as
List<MyObject> objects = // some objects;
int indexOfFirstDVD = someUtils.findIndex(objects, obj -> "DVD".equals(obj.getType()));
I know it's easy to write one with a for-loop, but is there any existing simple way to do that, such as streaming or any library utils?