mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 18:58:31 +07:00
12 lines
325 B
Java
12 lines
325 B
Java
// "Collapse loop with stream 'toArray()'" "true-preview"
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
public class Main {
|
|
public Object[] testToArray(List<String> data) {
|
|
Object[] arr = data.stream().filter(str -> !str.isEmpty()).toArray();
|
|
System.out.println(Arrays.toString(arr));
|
|
return arr;
|
|
}
|
|
} |