long (List<String> list) { long count = 0L; for (String l : list) { if (l != null) { (new Consumer<String>() { String lst = "hello"; public void accept(String lst) { System.out.println(this.lst + lst); } }).accept(l); count++; } } return count; }