I have a map like this
Map map=new HashMap();//HashMap key random order. map.put(\"a\",10); map.put(\"a\",20); map.put(\"a\",30); map.put(\"b\",10); System.
You shouldn't ignore the generic parameters. What you have is
Map map = new HashMap<>();
if you want to code the solution yourself, you need
Map> map = new HashMap<>();
Anyhow, the preffered way is to use a Guava Multimap