I have list of objects objList which has two fields age and id. age is long and id is String. I want to iterate over the list and get the id of object that has minimum age in the list. I can do it with a traditional for loop, but I am sure there would be a compact solution in java 8.
If I do objList.stream() and then check map functions on that stream, I just have mapToInt, mapToLong, and mapToDouble. With these I get the min age, but I need id of the object that has minimum age.
Its guaranteed that the list will not be empty and will have at least one object.
agebelong?Date, for example.