String (List<List<String>> list) { String res = null; OUTER: for(int i=0; i<10; i++) { String found = ""; OUTER1: for (List<String> x : list) { if (x != null) { for (String s : x) { found = s; break OUTER1; } } } res = found; } return res; }