mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-07 15:35:40 +07:00
GitOrigin-RevId: c4db6507c258e5611f6d47b9373a0c2531802345
15 lines
446 B
Java
15 lines
446 B
Java
// "Collapse loop with stream 'collect()'" "true-preview"
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
|
|
public class Main {
|
|
public List<Runnable> test(List<String> list) {
|
|
List<Runnable> result = list.stream().<Runnable>map(s -> () -> {
|
|
String str = s;
|
|
if (str.isEmpty()) str = "none";
|
|
System.out.println(str);
|
|
}).collect(Collectors.toList());
|
|
return result;
|
|
}
|
|
} |