mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-18 08:50:57 +07:00
12 lines
315 B
Java
12 lines
315 B
Java
// "Collapse loop with stream 'collect()'" "true-preview"
|
|
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
|
|
public class Test {
|
|
static String test(List<String> list) {
|
|
String sb = list.stream().filter(s -> !s.isEmpty()).collect(Collectors.joining());
|
|
String s = sb;
|
|
return s.trim();
|
|
}
|
|
} |