Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Use case of collectionUtils
package com.knoldus;
import org.apache.commons.collections4.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
public class LambdaEx {
public static void main(String[] args) {
ArrayList<String> list = null;
final List<String> modifiedCollection = CollectionUtils.emptyIfNull(list)
.map(elem -> elem + " ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment