mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-02 19:28:23 +07:00
20 lines
492 B
Java
20 lines
492 B
Java
// "Replace with toArray" "true"
|
|
import java.util.*;
|
|
|
|
public class Test {
|
|
Object[] test(List<String> list) {
|
|
List<Object> result = new LinkedList<>();
|
|
for(String str : lis<caret>t) {
|
|
if(str != null) {
|
|
Collections.addAll(result, str, str+str);
|
|
}
|
|
}
|
|
result.sort(null);
|
|
return result.toArray();
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
System.out.println(Arrays.toString(new Test().test(Arrays.asList("a", "b", "ba", "x", null, "c"))));
|
|
}
|
|
}
|