code: public static String[] toArray(List<String> list) {
          String[] ret = new String[list.size()];
          for (int i = 0; i < ret.length; i++)
              ret[i] = list.get(i);
          return ret;
      }
docs: Convert a string list into a array
  @param list the input to create the array from
  @return the created list