mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 15:50:53 +07:00
10 lines
329 B
Java
10 lines
329 B
Java
// "Collapse loop with stream 'collect()'" "true-preview"
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
|
|
class Test {
|
|
List<String> test(List<List<String>> list) {
|
|
List<String> result = list.stream().flatMap(Collection::stream).collect(Collectors.toList());
|
|
return Collections.unmodifiableList(result);
|
|
}
|
|
} |