mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-19 18:50:59 +07:00
13 lines
353 B
Java
13 lines
353 B
Java
// "Collapse loop with stream 'collect()'" "true-preview"
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
|
|
public class Test {
|
|
public static void test(List<String> data) {
|
|
List<String> result = data.stream().takeWhile(s -> !s.isEmpty()).collect(Collectors.toList());
|
|
System.out.println(result);
|
|
}
|
|
}
|