package edu.one.core.infra.collections;

import java.util.Arrays;

public class Joiner {

	private final String separator;

	private Joiner(String separator) {
		this.separator = separator;
	}

	public static Joiner on(String separator) {
		if (separator != null) {
			return new Joiner(separator);
		}
		return null;
	}

	public String join(Iterable<?> items) {
		StringBuilder sb = new StringBuilder();
		for (Object item: items) {
			sb.append(separator).append(item.toString());
		}
		return sb.substring(separator.length());
	}

	public String join(Object[] items) {
		return join(Arrays.asList(items));
	}

}

@@ -488,16 +488,53 @@
 %09%09return
+ (sb.length() %3E separator.length()) ?
  sb.subs
@@ -558,16 +558,21 @@
 ength())
+ : %22%22
 ;%0A%09%7D%0A%0A%09p

fix joiner with empty list