mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 18:58:31 +07:00
29 lines
866 B
Java
29 lines
866 B
Java
// "Replace Stream API chain with loop" "true"
|
|
|
|
import java.util.IntSummaryStatistics;
|
|
import java.util.List;
|
|
|
|
import static java.util.Arrays.asList;
|
|
|
|
public class Main {
|
|
public static IntSummaryStatistics test(List<List<List<String>>> list) {
|
|
IntSummaryStatistics stat = new IntSummaryStatistics();
|
|
for (List<List<String>> l : list) {
|
|
if (l != null) {
|
|
for (List<String> lst : l) {
|
|
if (lst != null) {
|
|
for (String str : lst) {
|
|
int length = str.length();
|
|
stat.accept(length);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return stat;
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
System.out.println(test(asList(asList(asList("a", "bbb", "ccc")), asList(), null, asList(asList("z")))));
|
|
}
|
|
} |