All,
I have a map with categories and subcategories as lists like this:
Map> cat = new HashMap
You have to search for the value in the entire map:
for (Entry> entry : cat.entrySet()) { for (String s : entry.getValue()) { if (s.equals("Carrot")) System.out.println(entry.getKey()); } }