If possible, you should design your code such that the collections aren’t null in the first place.
null collections are bad practice (for this reason); you should use empty collections instead. (eg, Collections.emptyList())
Alternatively, you could make a wrapper class that implements Iterable and takes a collections, and handles a null collection.
You could then write foreach(T obj : new Nullable<T>(list1))