键可重复的map
Multimap<Integer,String> mp = HashMultimap.create(); mp.put(1,"a"); mp.put(1,"b"); mp.put(1,"c"); mp.put(1,"c"); mp.put(2,"d"); Collection<String> c = mp.get(1); System.out.println(c.toString()); System.out.println(mp.size());
结果:
[a, b, c]
4