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