code: public static void join(StringBuilder sb, Collection<?> collection, String delimiter) {
          if (collection.isEmpty()) { return; }
          Iterator<?> it = collection.iterator();
          sb.append(it.next());
          while (it.hasNext()) {
              sb.append(delimiter);
              sb.append(it.next());
          }
      }
docs: Joins the items in collection with a delimiter, and appends the result to StringBuilder.
  
  @param sb StringBuilder to append result to
  @param collection collection of items to join.
  @param delimiter delimiter to insert between elements of collection.