mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-02 03:07:47 +07:00
18 lines
506 B
Java
18 lines
506 B
Java
// "Replace Stream API chain with loop" "true"
|
|
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.IntStream;
|
|
import java.util.stream.Stream;
|
|
|
|
public class Main {
|
|
private static List<String> test() {
|
|
return IntStream.range(0, 20).mapToObj(x -> x)
|
|
.flatMap(x -> Stream.iterate("", str -> "a"+str).limit(x))
|
|
.co<caret>llect(Collectors.toList());
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
System.out.println(String.join("|", test()).length());
|
|
}
|
|
} |