void () { Object map1 = Stream.of(1, 2, 3, 4).map(String::valueOf) .co<caret>llect(Collectors.toMap(String::trim, Function.identity(), (a, b) -> a, HashMap::new)); HashMap<String, String> map2 = Stream.of(1, 2, 3, 4).map(String::valueOf).collect(Collectors .toMap(String::trim, Function.identity(), (a, b) -> a, HashMap::new)); Map<String, String> map3 = Stream.of(1, 2, 3, 4).map(String::valueOf).collect(Collectors .toMap(String::trim, Function.identity(), (a, b) -> a, HashMap::new)); }