List<Integer> (boolean b, List<String> list) { int s; if(b) { s = 1; } List<Integer> result = new ArrayList<>(); for(String str : li<caret>st) { if(str != null) { result.add(s++); } } return result; }