private static String formatTextBox(String text, int width, Pattern splitter, Set<String> singleRowers) {
        requireNonNulls(text, splitter);
        requireNonNullElements(singleRowers);

        final StringBuilder sb = new StringBuilder();
        final AtomicInteger col = new AtomicInteger();
        final List<String> words = splitter.splitAsStream(text).collect(toList());
        for (final String w : words) {
            final int wordLen = w.length();
            if (singleRowers.contains(w)) {
                sb.append(NL);
                sb.append(w);
                sb.append(NL);
                col.set(0);
            } else {
                if (col.get() + wordLen >= width) {
                    sb.append(NL);
                    col.set(0);
                } else if (col.get() > 0) {
                    sb.append(" ");
                    col.incrementAndGet();
                }
                sb.append(w);
                col.getAndAdd(wordLen);
            }
        }
        return sb.toString();
    }
Creates and returns a String formatted so it will fit in a box with the
given width. Words in the singleRowers set will appear on a separate
line.

@param text the input text
@param width of the text box
@param splitter pattern to use for splitting up words
@param singleRowers a Set of Strings that shall be on a separate row
@return a String formatted so it will fit in a box with the given width
runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/util/TextUtil.java