Here you can find the source of join(final T[] collection)
public static <T> String join(final T[] collection)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; import java.util.Collection; public class Main { public static <T> String join(final T[] collection) { return join(Arrays.asList(collection)); }/*from ww w .j av a 2 s . c om*/ public static <T> String join(final T[] collection, final String separator) { return join(Arrays.asList(collection), separator); } public static String join(final Collection<?> collection) { return join(collection, ", "); } public static String join(final Collection<?> collection, final String joinString) { if (collection != null) { final StringBuilder str = new StringBuilder(); int i = 0; final int max = collection.size(); for (final Object object : collection) { str.append(object.toString()); if (++i < max) { str.append(joinString); } } return str.toString(); } else { return null; } } }