This is not a duplicate of the question that is linked. Does this mean I have to open a new question?
I have a Task class
class Task {
String personId;
String taskId;
int sum;
}
I have a list of Tasks - List
1 task50 9
1 task100 12
2 task50 10
3 task1 50
How do I do this?
Sort the list such that for taskid = task50, order by sum desc
Result list
2 task50 10
1 task50 9
1 task100 12
3 task1 50
To add a bit of clarity, result list should contain task50's at the top of the list sorted by sum in descending order. Rest of the list should appear as is in the original list.