This is a reimplementation of Java 8's String.join.
424366
private static String join(String sep, Collection<String> collection) {
    StringBuilder builder = new StringBuilder();
    boolean first = true;
    for (String element : collection) {
      if (first) {
        first = false;
      } else {
        builder.append(sep);
      }
      builder.append(element);
    }
    return builder.toString();
  }
252653
public M joinsWith(String separator, Object... join) {
		this.delegate = Optional.of(joinWith(separator, join));
		return THIS();
	}
25644
@NotNull
    public static Collector<CharSequence, ?, String> joining(@NotNull CharSequence delimiter) {
        return joining(delimiter, "", "");
    }
1067101
public static String join(String delimiter, Object... values) {
        // Since primitive arrays does not pass as a values array, but as it's
        // single first element.
        if (values.length == 1) {
            Class<?> type = values[0].getClass();
            if (char[].class.equals(type)) {
                return joinP(delimiter, (char[]) values[0]);
            } else if (int[].class.equals(type)) {
                return joinP(delimiter, (int[]) values[0]);
            } else if (long[].class.equals(type)) {
                return joinP(delimiter, (long[]) values[0]);
            } else if (double[].class.equals(type)) {
                return joinP(delimiter, (double[]) values[0]);
            } else if (boolean[].class.equals(type)) {
                return joinP(delimiter, (boolean[]) values[0]);
            }
        }

        StringBuilder builder = new StringBuilder();
        boolean first = true;
        for (Object value : values) {
            if (first) {
                first = false;
            } else {
                builder.append(delimiter);
            }
            builder.append(Objects.toString(value));
        }

        return builder.toString();
    }
953228
public static String join(Collection<String> s, String delimiter) {
        return join(s, delimiter, false);
    }
31836
@NotNull
    public static Collector<CharSequence, ?, String> joining(
            @NotNull CharSequence delimiter,
            @NotNull CharSequence prefix,
            @NotNull CharSequence suffix) {
        return joining(delimiter, prefix, suffix, prefix.toString() + suffix.toString());
    }
389570
private static String _join(String[] tokens, boolean excludeLast)
    {
        StringBuilder join = new StringBuilder();
        int length = tokens.length - (excludeLast ? 1 : 0);
        for (int i = 0; i < length; i++)
        {
            join.append(tokens[i]).append("/");
        }

        return join.toString();
    }
1066201
public M joins(Object... join) {
		this.delegate = Optional.of(join(join));
		return THIS();
	}
212858
public static <T> String join(T[] array, CharSequence conjunction, String prefix, String suffix) {
		if (null == array) {
			return null;
		}

		final StringBuilder sb = new StringBuilder();
		boolean isFirst = true;
		for (T item : array) {
			if (isFirst) {
				isFirst = false;
			} else {
				sb.append(conjunction);
			}
			if (ArrayUtil.isArray(item)) {
				sb.append(join(ArrayUtil.wrap(item), conjunction, prefix, suffix));
			} else if (item instanceof Iterable<?>) {
				sb.append(IterUtil.join((Iterable<?>) item, conjunction, prefix, suffix));
			} else if (item instanceof Iterator<?>) {
				sb.append(IterUtil.join((Iterator<?>) item, conjunction, prefix, suffix));
			} else {
				sb.append(StrUtil.wrap(StrUtil.toString(item), prefix, suffix));
			}
		}
		return sb.toString();
	}
986020
private static String joinString(String[] array) {
    StringBuilder sb = new StringBuilder();
    for (String value : array) {
      if (sb.length() > 0) {
        sb.append(" ");
      }
      sb.append(value);
    }
    return sb.toString();
  }
295528
public static void join(StringBuilder sb, Object[] array, String delimiter) {
        if (empty(array)) { return; }
        sb.append(array[0]);
        for (int i = 1; i < array.length; i++) {
            sb.append(delimiter);
            sb.append(array[i]);
        }
    }
848521
public static String join(String delimiter, String wrap, Iterable<?> objs) {
        Iterator<?> iter = objs.iterator();
        if (!iter.hasNext()) {
            return "";
        }
        StringBuilder buffer = new StringBuilder();
        buffer.append(wrap).append(iter.next()).append(wrap);
        while (iter.hasNext()) {
            buffer.append(delimiter).append(wrap).append(iter.next()).append(wrap);
        }
        return buffer.toString();
    }
254204
public static String join(String separator, Collection<String> stringsToJoin) {
        StringBuilder builder = new StringBuilder();
        // Check if there is at least 1 element then use do/while to avoid trailing separator
        int index = stringsToJoin.size();
        for (String str : stringsToJoin) {
            index--;
            if (str != null) {
                builder.append(str);
                if (index > 0) {
                    builder.append(separator);
                }
            }
        }
        return builder.toString();
    }
965032
public static String join(CharSequence delimiter, Iterable tokens) {
        StringBuilder sb = new StringBuilder();
        boolean firstTime = true;
        for (Object token: tokens) {
            if (firstTime) {
                firstTime = false;
            } else {
                sb.append(delimiter);
            }
            sb.append(token);
        }
        return sb.toString();
    }
378794
@Nonnull
    public static String join(@Nonnull Iterable<String> elements, @Nonnull String delimiter) {
        StringBuilder result = new StringBuilder();
        Iterator<String> it = elements.iterator();
        while (it.hasNext()) {
            String element = it.next();
            result.append(element);
            if (it.hasNext()) {
                result.append(delimiter);
            }
        }
        return result.toString();
    }
681063
def string_join_using_or_conjunction(strings)
      ret = ""
      strings.each_with_index do |str, i|
        case i
        when 0 # 最初の要素
        when strings.size - 1 # 最後の要素
          ret << " or "
        else
          ret << ", "
        end

        ret << str
      end

      ret
    end
77728
public static <T> String join(T[] array) {
        return new JoinStrings<T>().apply(new ArrayIterator<T>(array));
    }