In Java, i want to get subList from a list. i cannot use subList of java as i want sub list based on some valus in list.
I have List of DTO objects. DTO is like
MyClass myClass;
int hit;
And MyClass is like
String webName;
...
I want to get sublists which has same webName (i need to add total hits of webName and remove dupicate DTO objects which has same webName )
Judging from your question, what you have now is
and you want to get to
So just iterate over your dto’s, find the correct entry in a map, and add the hits to the container. The map will make sure you have only one entry per webname.
Then, if you really just want the bunch of sublists, just get it from the values