import java.nio.file.Path; import java.time.LocalDate; import java.util.List; import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; public class OldWay { public static void main(String[] args) { List words = List.of("apple", "avocado", "banana", "blueberry", "cherry"); Map> byInitial = words.stream() .collect(Collectors.groupingBy(w -> w.charAt(0))); System.out.println(byInitial); System.out.println(Path.of("a", "b", "c.txt") + " on " + LocalDate.of(2026, 9, 15)); } }