Runnable sources, deliberate compile failures, three small modules and nine captured transcripts for import module (JEP 511). Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TF9JWFvJSNm6HVzswzZU5a
18 lines
634 B
Java
18 lines
634 B
Java
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<String> words = List.of("apple", "avocado", "banana", "blueberry", "cherry");
|
|
Map<Character, List<String>> 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));
|
|
}
|
|
}
|