Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Need of apache commons for collections
package com.knoldus;
import java.util.ArrayList;
import java.util.stream.Collectors;
public class LambdaEx {
public static void main(String[] args) {
ArrayList<String> list1 = null;
list1.stream().map(elem -> elem + "Knoldus").collect(Collectors.toList());
list1.forEach(System.out::println);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment