mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-23 07:14:21 +07:00
10 lines
355 B
Java
10 lines
355 B
Java
// "Replace 'collect(minBy())' with 'min()' (may change semantics when result is null)" "true"
|
|
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
|
|
public class Main {
|
|
public Optional<String> min(List<String> data) {
|
|
return data.stream().filter(x -> x.startsWith("xyz")).collect(Collectors.minBy(Str<caret>ing.CASE_INSENSITIVE_ORDER));
|
|
}
|
|
} |