How to find index position of an element in a list when contains returns true
indexOf(object)
get(index)
Here is an example:
List<String> names;
names.add("toto");
names.add("Lala");
names.add("papa");
int index = names.indexOf("papa"); // index = 2
benefit.indexOf(map4)
It either returns an index or -1 if the items is not found.
I strongly recommend wrapping the map in some object and use generics if possible.