Here you can find the source of nullToEmpty(List
public static <T> List<T> nullToEmpty(List<T> in)
//package com.java2s; //License from project: Open Source License import java.util.Collections; import java.util.List; import java.util.Set; public class Main { public static <T> List<T> nullToEmpty(List<T> in) { return in == null ? Collections.<T>emptyList() : in; }//from w ww. j av a 2 s. c o m public static <T> Set<T> nullToEmpty(Set<T> in) { return in == null ? Collections.<T>emptySet() : in; } }