// "Replace with toArray" "true" import java.util.*; public class Main { public List[] testToArray(List data) { Set> result = new LinkedHashSet<>(); for (String str : data) { if (!str.isEmpty()) { List list = Collections.singletonList(str); result.add(list); } } return result.toArray(new List[0]); } }