I have a list of object which has 3 variables(id, version, root_id)
Eg : {(1, 3, 1001),(2,2,1001), (3,1,1001), (4,1,1002), (5,1,1003)}
I want to retain only 1 object having same root_id and having highest version number.
output : {(1, 3, 1001),(4,1,1002), (5,1,1003)}
How can I apply the java stream filter on the list to get the desired output. Please help. I am getting a bit confused on applying the filter.