mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-29 08:20:55 +07:00
13 lines
415 B
Java
13 lines
415 B
Java
// "Collapse loop with stream 'findFirst()'" "true-preview"
|
|
|
|
import java.util.Collection;
|
|
import java.util.List;
|
|
|
|
public class Main {
|
|
public static boolean find(List<List<String>> list) {
|
|
/*
|
|
Block comment
|
|
*/
|
|
return list.stream().flatMap(Collection::stream).filter(string -> string.startsWith("ABC")).findFirst().filter(string -> string.substring(3).equals("xyz")).isPresent();
|
|
}
|
|
} |