void () { TreeMap<Integer, Set<String>> result = new TreeMap<>(); for (Integer i2 : Arrays.asList(1, 2, 3, 4)) { String s1 = String.valueOf(i2); result.computeIfAbsent(s1.length(), k2 -> new HashSet<>()).add(s1); } Object map1 = result; TreeMap<Integer, Set<String>> map2 = new TreeMap<>(); for (Integer integer1 : Arrays.asList(1, 2, 3, 4)) { String value = String.valueOf(integer1); map2.computeIfAbsent(value.length(), key1 -> new HashSet<>()).add(value); } NavigableMap<Integer, Set<String>> map3 = new TreeMap<>(); for (Integer i1 : Arrays.asList(1, 2, 3, 4)) { String valueOf = String.valueOf(i1); map3.computeIfAbsent(valueOf.length(), k1 -> new HashSet<>()).add(valueOf); } SortedMap<Integer, Set<String>> map4 = new TreeMap<>(); for (Integer integer : Arrays.asList(1, 2, 3, 4)) { String string = String.valueOf(integer); map4.computeIfAbsent(string.length(), key -> new HashSet<>()).add(string); } TreeMap<Integer, Set<String>> map = new TreeMap<>(); for (Integer i : Arrays.asList(1, 2, 3, 4)) { String s = String.valueOf(i); map.computeIfAbsent(s.length(), k -> new HashSet<>()).add(s); } Cloneable map5 = map; }