max,minは、Comparatorを渡す
public class Outer {
public static void main(String[] args) {
List<String> l = List.of("C","X","A");
l.stream().max((a,b) -> a.compareTo(b)).ifPresent(System.out::println);
l.stream().min((a,b) -> a.compareTo(b)).ifPresent(System.out::println);
}
}
X
A