code: @NonNull
      public static String[] nonNullArrayOfStrings(@Nullable List<String> list) {
          return list == null || list.isEmpty()
                  ? new String[]{}
                  : list.toArray(new String[list.size()]);
      }
docs: Converts list of strings to non-null array of strings.
  
  @param list of strings.
  @return non-null array of strings.