Here you can find the source of addNotNull(List
public static <T> List<T> addNotNull(List<T> list, T t)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static <T> List<T> addNotNull(List<T> list, T t) { if (t != null) list.add(t);/*from ww w. j a va 2 s. c o m*/ return list; } }