jetbrick-commons/src/main/java/jetbrick/lang/StringUtils.java
public static String repeat(final String s, final String separator, final int repeat) {
        if (s == null || separator == null) {
            return repeat(s, repeat);
        }
        // given that repeat(String, int) is quite optimized, better to rely on
        // it than try and splice this into it
        final String result = repeat(s + separator, repeat);
        return removeEnd(result, separator);
    }
public static String repeat(final String s, final String separator, final int repeat) {
        if (s == null || separator == null) {
            return repeat(s, repeat);
        }
        // given that repeat(String, int) is quite optimized, better to rely on
        // it than try and splice this into it
        final String result = repeat(s + separator, repeat);
        return removeEnd(result, separator);
    }
<p>
Repeat a String {@code repeat} times to form a new String, with a String
separator injected each time.
</p>

<pre>
StringUtils.repeat(null, null, 2) = null
StringUtils.repeat(null, "x", 2)  = null
StringUtils.repeat("", null, 0)   = ""
StringUtils.repeat("", "", 2)     = ""
StringUtils.repeat("", "x", 3)    = "xxx"
StringUtils.repeat("?", ", ", 3)  = "?, ?, ?"
</pre>