mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +07:00
24 lines
695 B
Java
24 lines
695 B
Java
// "Replace Stream API chain with loop" "true"
|
|
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.LongSummaryStatistics;
|
|
|
|
public class Main {
|
|
public static LongSummaryStatistics test(List<List<String>> list) {
|
|
LongSummaryStatistics stat = new LongSummaryStatistics();
|
|
for (List<String> a : list) {
|
|
if (a != null) {
|
|
for (String s : a) {
|
|
long length = s.length();
|
|
stat.accept(length);
|
|
}
|
|
}
|
|
}
|
|
return stat;
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
System.out.println(test(Arrays.asList(null, Arrays.asList("aaa", "b", "cc", "dddd"), Arrays.asList("gggg"))));
|
|
}
|
|
} |