mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-04 20:30:42 +07:00
11 lines
344 B
Java
11 lines
344 B
Java
// "Replace with collect" "true"
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
|
|
public class Test {
|
|
List<String> test(int[] repeats) {
|
|
List<String> result = Arrays.stream(repeats).mapToObj(val -> Collections.nCopies(val, String.valueOf(val))).flatMap(Collection::stream).collect(Collectors.toList());
|
|
return result;
|
|
}
|
|
}
|