public static < T > List < T > createWhenNull ( final List < T > list ) { if ( list == null ) { return new ArrayList < T > ( ) ; } else { return list ; } }
Returns the list when it is not null . Returns a new list otherwise .