mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-28 06:51:01 +07:00
12 lines
332 B
Java
12 lines
332 B
Java
// "Collapse loop with stream 'anyMatch()/noneMatch()/allMatch()'" "true-preview"
|
|
|
|
import java.util.List;
|
|
|
|
public class Main {
|
|
public void testAssignment(List<String> data) {
|
|
String[] found = {"no"};
|
|
if (data.stream().map(String::trim).anyMatch(trimmed -> !trimmed.isEmpty())) {
|
|
found[0] = "yes";
|
|
}
|
|
}
|
|
} |