// "Replace with findFirst()" "true" import java.util.*; public class Main { public Integer[] testFindFirstIfPresent(List> data) { List result = new ArrayList<>(); for (List list : data) { for (String str : list) { if (!str.isEmpty()) { result.add(str.length()); break; } } } return result.toArray(new Integer[result.size()]); } }