code: public static <T> String listToString(List<T> list) {
      StringBuilder sb = new StringBuilder();
      for (T s : list) {
        if (sb.length() != 0) {
          sb.append(" ");
        }
        sb.append(s);
      }
      return sb.toString();
    }
docs: Converts a list of objects to a string.
  
  @param list list of objects
  @param <T> type of the objects
  @return space-separated concatenation of the string representation returned by Object#toString
  of the individual objects