Here you can find the source of newListIfNull(List
public static <T> List<T> newListIfNull(List<T> list)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { public static <T> List<T> newListIfNull(List<T> list) { if (list == null) { return new ArrayList<T>(); } else {/* w ww . j av a2 s .c o m*/ return list; } } }