mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-20 20:20:56 +07:00
14 lines
391 B
Java
14 lines
391 B
Java
// "Collapse loop with stream 'anyMatch()/noneMatch()/allMatch()'" "true-preview"
|
|
|
|
import java.util.List;
|
|
|
|
public class Main {
|
|
public void testAssignment(List<String> data) {
|
|
boolean found;
|
|
if (data.size() > 10) {
|
|
System.out.println("Big data");
|
|
}
|
|
found = data.stream().map(String::trim).anyMatch(trimmed -> !trimmed.isEmpty());
|
|
System.out.println(found);
|
|
}
|
|
} |