public static <T> List<T> asList(T obj, boolean evenIfNull) {
        if(obj==null && !evenIfNull){
            return Objects.newArrayList();
        }else if(obj instanceof List){
            return (List<T>)obj;
        }else{
            return Objects.newArrayList(obj);
        }
    }
public static < T > List < T > asList ( T obj , boolean evenIfNull ) { if ( obj == null && ! evenIfNull ) { return Objects . newArrayList ( ) ; } else if ( obj instanceof List ) { return ( List < T > ) obj ; } else { return Objects . newArrayList ( obj ) ; } }
@param obj
@param evenIfNull
@param <T>
@return