private <T> void addToListIfStringNotNullAndNotEmpty(List<T> list, String str, T item) {

        if (str != null && !str.isEmpty()) {
            list.add(item);
        }
    }
private <T> void addToListIfStringNotNullAndNotEmpty(List<T> list, String str, T item) {

        if (str != null && !str.isEmpty()) {
            list.add(item);
        }
    }
private < T > void addToListIfStringNotNullAndNotEmpty ( List < T > list , String str , T item ) { if ( str != null && ! str . isEmpty ( ) ) { list . add ( item ) ; } }
Add item to the list if the string is not null *and* not empty

@param list
@param str
@param item
@param <T>
Add item to the list if the string is not null * and * not empty