mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-24 14:26:37 +07:00
10 lines
327 B
Java
10 lines
327 B
Java
// "Replace 'collect(maxBy())' with 'max()' (may change semantics when result is null)" "true"
|
|
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
|
|
public class Main {
|
|
public String max(List<String> data) {
|
|
return data.stream().filter(x -> x.startsWith("xyz")).max(String.CASE_INSENSITIVE_ORDER).orElse("");
|
|
}
|
|
} |