private boolean startsWith(final StringBuilder stringBuilder, final String prefix) {
        Objects.requireNonNull(stringBuilder);
        Objects.requireNonNull(prefix);
        return stringBuilder.indexOf(prefix) == 0;
    }
Reduces the current length of a <code>StringBuilder</code> to trim any
whitespace off the end of the buffer.

@param sb The <code>StringBuilder</code> to trim.
stroom-core-client-widget/src/main/java/stroom/editor/client/model/XmlFormatter.java