public static String joinWith(String delimiter, List<String> lines) {
        if (lines.size() == 0) {
            return EMPTY;
        }
        int i = 0;
        StringBuilder sb = new StringBuilder();
        for (String line : lines) {
            if (i++ > 0) {
                sb.append(delimiter);
            }
            sb.append(line);
        }
        return sb.toString();
    }
<p>Repeat a String {@code repeat} times to form a
new String.</p>

<pre>
StringUtils.repeat(null, 2) = null
StringUtils.repeat("", 0)   = ""
StringUtils.repeat("", 2)   = ""
StringUtils.repeat("a", 3)  = "aaa"
StringUtils.repeat("ab", 2) = "abab"
StringUtils.repeat("a", -2) = ""
</pre>

@param str    the String to repeat, may be null
@param repeat number of times to repeat str, negative treated as zero
@return a new String consisting of the original String repeated,
{@code null} if null String input
tika-core/src/main/java/org/apache/tika/utils/StringUtils.java