private static String alignRight(String substring, int totalWidth, char fill) {
        if (substring.length() > totalWidth) {
            return substring.substring(0, totalWidth);
        } else {
            return repeat("" + fill, totalWidth - substring.length()) + substring;
        }
    }
Returns a string of the specified length where the substring is located
to the right, padded with a character on the left. If the specified 
{@code totalWidth} is less than the length of the substring, the
substring is returned but with the overflowing characters removed.

@param substring   the substring to align
@param totalWidth  the width of the returned string
@param fill        the character to use for padding
@return            the padded string
runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/util/TextUtil.java