mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-03 11:47:50 +07:00
11 lines
334 B
Java
11 lines
334 B
Java
// "Collapse loop with stream 'collect()'" "true-preview"
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.IntStream;
|
|
|
|
class A {
|
|
public List<? super Integer> sum() {
|
|
List<? super Integer> result = IntStream.range(0, 10).mapToObj(i -> i * 2).collect(Collectors.toList());
|
|
return result;
|
|
}
|
|
} |