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