Skip to content

Instantly share code, notes, and snippets.

@kunals201
Last active May 1, 2019 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunals201/f979cb894ad3d43ed3c80d0a6ca30f39 to your computer and use it in GitHub Desktop.
Save kunals201/f979cb894ad3d43ed3c80d0a6ca30f39 to your computer and use it in GitHub Desktop.
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