I am new to java 8 stream api and I am seeking for a solution to run through my list of objects and aggretate certain property to be able in the end to get a new list of that property type and all the aggreation results.
for example my list has 10 person objects inside and i want a list of all the age differences based on first persons age
is that even in java possible with stream?
for example:
person1.age = 10
person2.age = 12
person3.age = 20
person4.age = 25
person5.age = 30
after doing stream magic the results should of type int and be looking like this
0
2 //based on first age 12 - 10
10 // based on first age 20 - 10
15 // ...
20