📅  最后修改于: 2022-03-11 14:52:07.134000             🧑  作者: Mango
Map> myMaps = new HashMap>();
for (DataObject item : myList) {
if (!myMaps.containsKey(item.getKey())) {
myMaps.put(item.getKey(), new ArrayList());
}
myMaps.get(item.getKey()).add(item.getValue());
}