mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 18:58:31 +07:00
21 lines
566 B
Java
21 lines
566 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<String> list) {
|
|
LongSummaryStatistics stat = new LongSummaryStatistics();
|
|
for (String s : list) {
|
|
System.out.println(s);
|
|
long length = s.length();
|
|
stat.accept(length);
|
|
}
|
|
return stat;
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
System.out.println(test(Arrays.asList("aaa", "b", "cc", "dddd")));
|
|
}
|
|
} |