Here you can find the source of nullSafe(Collection
public static <T> Collection<T> nullSafe(Collection<T> collection)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static <T> Collection<T> nullSafe(Collection<T> collection) { return collection == null ? Collections.emptyList() : collection; }/*w w w.java 2 s.c o m*/ }