mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-18 00:20:54 +07:00
13 lines
297 B
Java
13 lines
297 B
Java
// "Collapse loop with stream 'anyMatch()/noneMatch()/allMatch()'" "true-preview"
|
|
|
|
import java.util.List;
|
|
|
|
public class Main {
|
|
public boolean testAnyMatch(List<String> data) {
|
|
int x = 10;
|
|
if (data.stream().map(String::trim).anyMatch(String::isEmpty)) {
|
|
x *= 2;
|
|
}
|
|
}
|
|
|
|
} |