// "Replace with findFirst()" "false" import java.util.*; // The result will have block-lambda so we don't suggest the replacement here 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()); System.out.println(str); break; } } } return result.toArray(new Integer[result.size()]); } }