Java ArrayList merge without duplicates based on a value -
i have class called sample , class has property arraylist<area> , , area contains arraylist<elements> public class sample { private arraylist<area> sampleareas; public arraylist<element> getmergeddata() { ... } ... } public class area { private arraylist<element> areaelements ... } public class element { private string name; private float value; ... } i need getmergeddata() sample class merges every arraylist<elements> each of it's area, keeping element bigger value. ex: area 1: ("element k" => 1.0, "element c" => 0.5, "element as" => 15.0) area 2: ("element k" => 10.1, "element c" => 5.5, "element as" => 2.9, "element o" => 1.5) area 3: ("element c" => 2.8, "element as" => 0.5, "element o" => 5.8) area 4: ("element k" => 3.25, "e...