mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-25 10:51:06 +07:00
10 lines
270 B
Java
10 lines
270 B
Java
// "Collapse loop with stream 'findFirst()'" "true-preview"
|
|
|
|
import java.util.Arrays;
|
|
import java.util.Objects;
|
|
|
|
public class Main {
|
|
public String test(String[] array) {
|
|
return Arrays.stream(array).limit(11).filter(Objects::nonNull).findFirst().orElse("");
|
|
}
|
|
} |