Map<String, List<Item>> items = new HashMap<>(); items.computeIfAbsent(key, k -> new ArrayList<>()).add(item);