mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-28 06:51:01 +07:00
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;
|
|
}
|
|
} |