List<String> (String[] data) { int top = Math.min(10, data.length); List<String> result = Arrays.stream(data).limit(10).map(String::trim).filter(item -> !item.isEmpty()).collect(Collectors.toList()); return result; }