Here you can find the source of join(final Collection> list, final String inbetween)
@SuppressWarnings("unused") public static String join(final Collection<?> list, final String inbetween)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.util.Collection; public class Main { @SuppressWarnings("unused") public static String join(final Collection<?> list, final String inbetween) { final StringBuilder builder = new StringBuilder(); for (final Object object : list) { if (builder.length() > 0) { builder.append(inbetween); }/*from w ww .j av a2 s .com*/ builder.append(object.toString()); } return builder.toString(); } }