code: public static String join(Collection<?> objects, String separator) {
          String result = null;
  
          if (objects.size() > 0) {
              for (Object object : objects) {
                  if (result == null) {
                      result = object.toString();
                  } else {
                      result += separator + object.toString();
                  }
              }
          } else {
              result = "";
          }
  
          return result;
      }
docs: Joins strings or objects string representations using given separator.
  
  @param objects a collection of objects to convert to string and join
  @param separator a string to use a separator
  @return string containing strings joined using separator