mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 18:50:54 +07:00
16 lines
382 B
Java
16 lines
382 B
Java
// "Collapse loop with stream 'anyMatch()'" "true-preview"
|
|
|
|
import java.util.List;
|
|
|
|
public class Main {
|
|
public void testAssignment(List<String> data) {
|
|
boolean found = false;
|
|
try {
|
|
found = data.stream().map(String::trim).anyMatch(trimmed -> !trimmed.isEmpty());
|
|
}
|
|
catch(Exception ex) {
|
|
ex.printStackTrace();
|
|
}
|
|
System.out.println(found);
|
|
}
|
|
} |