mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-08 21:52:48 +07:00
GitOrigin-RevId: c4db6507c258e5611f6d47b9373a0c2531802345
13 lines
424 B
Java
13 lines
424 B
Java
// "Collapse loop with stream 'collect()'" "true-preview"
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
import java.util.stream.Collectors;
|
|
|
|
public class Main {
|
|
public List<Integer> test(int[][] arr) {
|
|
List<Integer> result = Arrays.stream(arr).filter(Objects::nonNull).flatMapToInt(Arrays::stream).boxed().collect(Collectors.toList());
|
|
return result;
|
|
}
|
|
} |