void (List<String> test) { Runnable r = () -> { List<String> result; System.out.println("We're inside the lambda"); result = test.stream().map(String::trim).collect(Collectors.toList()); System.out.println(result); }; r.run(); }