Here you can find the source of copyNullSafeMutableList(Collection extends E> list)
public static <E> ArrayList<E> copyNullSafeMutableList(Collection<? extends E> list)
//package com.java2s; //License from project: LGPL import java.util.ArrayList; import java.util.Collection; public class Main { public static <E> ArrayList<E> copyNullSafeMutableList(Collection<? extends E> list) { if (list == null) throw new NullPointerException("list"); ArrayList<E> result = new ArrayList<E>(list); for (E element : result) { if (element == null) throw new NullPointerException("element"); }/*from w w w .j a va 2 s . c om*/ return result; } }