// "Replace with toArray" "true" import java.util.*; public class Test { Object[] test(List list) { List result = new LinkedList<>(); for(String[] str : list) { if(str != null) { Collections.addAll(result, str); } } result.sort(null); return result.toArray(); } }