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