If you using Java 8 then try this:
Map<String, Set<String>> map = new TreeMap<>();
map.put("Anna", new HashSet(Arrays.asList(8999)));
map.put("Ira", new HashSet(Arrays.asList(8777, 8666)));
map.put("Artur",new HashSet(Arrays.asList(5444, 6555)));
If your using Java 9+ then use Set.of
. But note this set created using of
method is unmodifiable.
Example:
Set.of(8999)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…