mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 18:58:31 +07:00
19 lines
397 B
Java
19 lines
397 B
Java
// "Replace Stream API chain with loop" "true"
|
|
|
|
import java.util.List;
|
|
|
|
import static java.util.Arrays.asList;
|
|
|
|
public class Main {
|
|
public static int test(List<String> list) {
|
|
Integer acc = 0;
|
|
for (String s : list) {
|
|
acc = acc + s.length();
|
|
}
|
|
return acc;
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
System.out.println(test(asList("a", "b", "c")));
|
|
}
|
|
} |