mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-09 16:39:37 +07:00
13 lines
334 B
Java
13 lines
334 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;
|
|
arr = data.stream().filter(str -> !str.isEmpty()).toArray();
|
|
System.out.println(Arrays.toString(arr));
|
|
return arr;
|
|
}
|
|
} |