我正在使用Google Guava 12的MultiMap,像这样:
Multimap<Integer, OccupancyType> pkgPOP = HashMultimap.create();
在将值插入到此多映射中后,我需要返回:
Map<Integer, Set<OccupancyType>>
不过,当我执行以下操作:
return pkgPOP.asMap();
它返回给我
Map<Integer, Collection<OccupancyType>>
如何返回 Map<Integer, Set<OccupancyType>>
?