mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-11 11:36:59 +07:00
19 lines
492 B
Java
19 lines
492 B
Java
// "Replace with collect" "true"
|
|
import java.util.*;
|
|
|
|
public class Main {
|
|
private Map<Integer, List<String>> test(String... list) {
|
|
Map<Integer, List<String>> map = new HashMap<>();
|
|
for(String s : li<caret>st) {
|
|
if(s != null) {
|
|
map.computeIfAbsent(s.length(), k -> new ArrayList<>()).add(s);
|
|
}
|
|
}
|
|
return map;
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
System.out.println(new Main().test("a", "bbb", null, "cc", "dd", "eedasfasdfs", "dd"));
|
|
}
|
|
}
|