public static String join(String joinWith, boolean prefix, boolean postfix, String... objects) {
        StringBuilder sb;
        if (prefix) {
            sb = new StringBuilder(joinWith);
        } else {
            sb = new StringBuilder();
        }

        for (int i = 0; i < objects.length; ) {
            sb.append(objects[i]);
            if (i++ < objects.length) {
                sb.append(joinWith);
            }
        }

        if (postfix) {
            sb.append(joinWith);
        }

        return sb.toString();
    }
Joins the supplied strings, optionally prefixing and postfixing the returned string.

@param joinWith the string used to join the strings
@param prefix prefix the returned string with {@code joinWith}
@param postfix postfix the returned string with {@code joinWith}
@param objects the strings to be joined
@return the joined strings
src/test/java/io/fabric8/maven/docker/util/PathTestUtil.java