List<Integer> (List<List<String>> data) { List<Integer> result = new ArrayList<>(); if (!data.isEmpty()) { data.stream().flatMap(Collection::stream).filter(str -> !str.isEmpty()).findFirst().ifPresent(str -> result.add(str.length())); } return result; }