mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-02 03:07:47 +07:00
22 lines
607 B
Java
22 lines
607 B
Java
// "Replace Stream API chain with loop" "true"
|
|
|
|
import java.util.*;
|
|
import java.util.function.UnaryOperator;
|
|
import java.util.stream.Collectors;
|
|
|
|
public class Main {
|
|
public static void test(List<String> strings) {
|
|
Map<Boolean, LinkedHashSet<String>> map = new HashMap<>();
|
|
map.put(false, new LinkedHashSet<>());
|
|
map.put(true, new LinkedHashSet<>());
|
|
for (String s : strings) {
|
|
map.get(s.length() > 2).add(s);
|
|
}
|
|
System.out.println(map);
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
test(Arrays.asList("a", "bbb", "cccc", "dddd", "ee", "e", "e"));
|
|
}
|
|
}
|